On Apr 22, 2009, at 4:38 PM, Pavel Ivanov wrote:

> I've tried to set pragma synchronous = on (it's off by default for
> me), but it makes application to work 5 times slower which is not
> acceptable for me. I would be happy if there was some solution in
> between that, i.e. for example just a bit slower operation on every
> pwrite but without 8 seconds-peaks.

Perhaps you can occasionally wrap a transaction with:
PRAGMA synchronous = NORMAL;
< do the transaction >
PRAGMA synchronous = OFF;

which would flush OS allocated database cache buffers; do this one out  
of N transactions. If you have threads performing transactions that  
are not otherwise communicating, you base this decision on a random  
number [rand() % N == 1]. Tune N to achieve the maximum pwrite time  
you need.

Caveat: I have never tried this; I don't use PRAGMA synchronous = OFF.

e

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

Reply via email to