Lars Aronsson wrote:
> I'm using SQLite 3.4.2, which is the standard package in 
> Ubuntu Linux 7.10.  I'm running this on an otherwise idle 
> Intel Core 2 Duo CPU with 4 GB of RAM.  The operation takes 
> several hours and still running.  Performance graphs indicate 
> lots of iowait, with many thousand blocks being written to 
> disk each second.  But very little CPU power is being used.  
> Is that reasonable?

It sounds to me like your operating system is doing a really bad job of
caching. What is the output of "cat /proc/meminfo", "cat
/proc/sys/vm/swappiness", and "cat /proc/sys/vm/dirty_ratio"?

How much free memory do you have when this is happening? What is your
vm.swappiness If nothing else is running then the operating system
should be able to cache the files in the buffer
> 
> Do I need to use PRAGMA cache_size?

I would try setting the cache size to ~3GB (PRAGMA cache_size=X, where
X=3000000000/the page size). The default page size is only 2000, which
is thousands of times smaller than what you have available. Or, try
setting it to whatever virtual memory you have (4GB+swap size - 1GB) and
let the operating system handle all the disk I/O via swapping. Just make
sure that other processes aren't actively using memory.

If none that doesn't help, then try decreasing the cache size and
increasing your /proc/sys/vm/dirty_ratio and
/proc/sys/vm/background_dirty_ratio to 95 each. 

- Brian

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to