<br><br><div class="gmail_quote">2008/10/23 Alvaro Marín <span dir="ltr"><<a href="mailto:alvaro@hostalia.com">alvaro@hostalia.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
I'm getting this error continuosly when the server's load is high:<br>
<br>
MailScanner[29045]: database is locked(5) at dbdimp.c line 402<br>
<br>
and the message scanning slows a lot.<br>
<br>
I see that:<br>
<br>
# grep timeout .cpan/build/DBD-SQLite-1.14-hR9dHa/dbdimp.h -i<br>
/* 30 second timeout by default */<br>
#define SQL_TIMEOUT 30000<br>
<br>
the timeout is 30secs by default in SQLite, perhaps too high (I prefer<br>
scan the message again instead of wait 30secs).<br>
<br>
So I've modified MailScanner's SA.pm and added:<br>
<br>
$MailScanner::SA::cachedbh->func( "2000", 'busy_timeout');<br>
<br>
to set it to 2 seconds, after the connection to the cache db:<br>
<br>
$MailScanner::SA::cachedbh = DBI->connect(<br>
<br>
"dbi:SQLite:$MailScanner::SA::cachefilename",<br>
"","",{PrintError=>0,InactiveDestroy=>1});<br>
<br>
<br>
I've tested it and it seems that works fine; is this a safe way to do<br>
this? Perhaps recompile SQLite changing that value is better?<br>
<br>
Regards,</blockquote><div><br>Do you have the SA-cache on tmpfs? mounting in tmpfs should be fast enough to keep happy MS.<br> <br>Regards,<br><br>Eduardo.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
--<br>
Alvaro Marín Illera<br>
Hostalia Internet<br>
<a href="http://www.hostalia.com" target="_blank">www.hostalia.com</a><br>
<font color="#888888"><br>
--<br>
MailScanner mailing list<br>
<a href="mailto:mailscanner@lists.mailscanner.info">mailscanner@lists.mailscanner.info</a><br>
<a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner" target="_blank">http://lists.mailscanner.info/mailman/listinfo/mailscanner</a><br>
<br>
Before posting, read <a href="http://wiki.mailscanner.info/posting" target="_blank">http://wiki.mailscanner.info/posting</a><br>
<br>
Support MailScanner development - buy the book off the website!<br>
</font></blockquote></div><br>