Running in an unsafe mode for speed does not mean that ultimately there 
will have to be no writes,

Perhaps you could devise a system where you post writes to a queue and 
have another thread or process perform the writes asynchronously.  You 
would then use otherwise idle machine time for writing and avoid the 
"freezing".

Doug Currie wrote:
> 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
>   

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

Reply via email to