database is locked(5) at dbdimp.c line 402

Eduardo Casarero ecasarero at gmail.com
Sat Oct 25 00:11:44 IST 2008


2008/10/23 Alvaro Marín <alvaro at hostalia.com>

> Hello,
>
> I'm getting this error continuosly when the server's load is high:
>
> MailScanner[29045]: database is locked(5) at dbdimp.c line 402
>
> and the message scanning slows a lot.
>
> I see that:
>
> # grep timeout .cpan/build/DBD-SQLite-1.14-hR9dHa/dbdimp.h  -i
> /* 30 second timeout by default */
> #define SQL_TIMEOUT 30000
>
> the timeout is 30secs by default in SQLite, perhaps too high (I prefer
> scan the message again instead of wait 30secs).
>
> So I've modified MailScanner's SA.pm and added:
>
>          $MailScanner::SA::cachedbh->func( "2000", 'busy_timeout');
>
> to set it to 2 seconds, after the connection to the cache db:
>
>          $MailScanner::SA::cachedbh = DBI->connect(
>
> "dbi:SQLite:$MailScanner::SA::cachefilename",
>                                  "","",{PrintError=>0,InactiveDestroy=>1});
>
>
> I've tested it and it seems that works fine; is this a safe way to do
> this? Perhaps recompile SQLite changing that value is better?
>
> Regards,


Do you have the SA-cache on tmpfs? mounting in tmpfs should be fast enough
to keep happy MS.

Regards,

Eduardo.

>
>
> --
> Alvaro Marín Illera
> Hostalia Internet
> www.hostalia.com
>
> --
> MailScanner mailing list
> mailscanner at lists.mailscanner.info
> http://lists.mailscanner.info/mailman/listinfo/mailscanner
>
> Before posting, read http://wiki.mailscanner.info/posting
>
> Support MailScanner development - buy the book off the website!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20081024/3b854c13/attachment.html


More information about the MailScanner mailing list