<br><br><div class="gmail_quote">2008/10/23 Alvaro Marín <span dir="ltr">&lt;<a href="mailto:alvaro@hostalia.com">alvaro@hostalia.com</a>&gt;</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&#39;m getting this error continuosly when the server&#39;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 &nbsp;-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&#39;ve modified MailScanner&#39;s SA.pm and added:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$MailScanner::SA::cachedbh-&gt;func( &quot;2000&quot;, &#39;busy_timeout&#39;);<br>
<br>
to set it to 2 seconds, after the connection to the cache db:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$MailScanner::SA::cachedbh = DBI-&gt;connect(<br>
<br>
&quot;dbi:SQLite:$MailScanner::SA::cachefilename&quot;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;&quot;,&quot;&quot;,{PrintError=&gt;0,InactiveDestroy=&gt;1});<br>
<br>
<br>
I&#39;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>&nbsp;<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>