<span id="spnSign20135241748"></span><div>hi,Martin,could you tell me more please,i see the url,but can't understand how to use the cron-job method instead of Bayes expirey options.&nbsp;</div><div><br></div><div>&nbsp;</div>------------------ 原始邮件 ------------------<br><br>发件人:东风 <dongwind@21cn.com><br>时 间:2013/05/23 16:22:10 星期四<br>收件人:mailscanner@lists.mailscanner.info<br>抄送人:<br>主  题:MailScanner SpamAssassin Timeout cause CPU100%<br><br><span id="spnSign20135231621"></span><div> dear all,</div>

<div>    Recently my MailScanner do not run very 

well.MailScanner SpamAssassin Timeout randomly,and when SpamAssassin Timeout,the 

MailScanner process will occupancy CPU 100%,and after a few minutes ,the 

MailScanner process will also occupancy all memery,then the system load is too 

high ,and the system can't work.</div>

<div>    I google it,do as the people said,set spam.assassinprefs.conf :</div>

<div style="FONT-STYLE: italic">use_bayes 1 </div>

<div style="FONT-STYLE: italic">bayes_auto_expire 0 </div>

<div>    But it can't fix the problem.then i run</div>

<div>#MailScanner --debug --debug-sa </div>

<div>    I found the point.Every time when the MailScanner process occupancy CPU 

100%,the log is stop at:</div>

<div> </div>

<div>

<div>05:33:31 May 22 05:33:31.411 [5327] dbg: bayes: found bayes db version 3</div>

<div>05:33:31 May 22 05:33:31.411 [5327] dbg: locker: refresh_lock: refresh /var/spool/MailScanner/spamassassin/bayes.lock</div>

<div>05:33:31 May 22 05:33:31.525 [5327] dbg: locker: refresh_lock: refresh /var/spool/MailScanner/spamassassin/bayes.lock</div>

<div>05:33:31 May 22 05:33:31.611 [5327] dbg: locker: refresh_lock: refresh /var/spool/MailScanner/spamassassin/bayes.lock</div>

<div>05:33:31 May 22 05:33:31.694 [5327] dbg: locker: refresh_lock: refresh /var/spool/MailScanner/spamassassin/bayes.lock</div>

<div>05:33:31 May 22 05:33:31.779 [5327] dbg: locker: refresh_lock: refresh /var/spool/MailScanner/spamassassin/bayes.lock</div>

<div>05:33:31 May 22 05:33:31.781 [5327] dbg: bayes: synced databases from journal in 0 seconds: 4023 unique entries (5977 total entries)</div>

<div>05:33:31 May 22 05:33:31.783 [5327] dbg: bayes: bayes journal sync completed</div>

<div>05:33:31 May 22 05:33:31.783 [5327] dbg: plugin: Mail::SpamAssassin::Plugin::Bayes=HASH(0x15c43580) implements 'learner_expire_old_training', priority 0</div>

<div>05:33:31 May 22 05:33:31.783 [5327] dbg: bayes: expiry starting</div>

<div>05:33:31 May 22 05:33:31.784 [5327] dbg: locker: refresh_lock: refresh /var/spool/MailScanner/spamassassin/bayes.lock</div>

<div>05:33:31 May 22 05:33:31.784 [5327] dbg: locker: refresh_lock: refresh /var/spool/MailScanner/spamassassin/bayes.lock</div>

<div>05:33:31 May 22 05:33:31.784 [5327] dbg: bayes: DB expiry: tokens in DB: 16022840, Expiry max size: 150000, Oldest atime: 1346656738, Newest atime: 1369170442, Last expire: 1346700571, Current time: 1369172011</div>

<div>05:33:31 May 22 05:33:31.785 [5327] dbg: bayes: expiry check keep size, 0.75 * max: 112500</div>

<div>05:33:31 May 22 05:33:31.785 [5327] dbg: bayes: token count: 16022840, final goal reduction size: 15910340</div>

<div>05:33:31 May 22 05:33:31.785 [5327] dbg: bayes: first pass? current: 1369172011, Last: 1346700571, atime: 43200, count: 265804, newdelta: 721, ratio: 59.8574137334276, period: 43200</div>

<div>05:33:31 May 22 05:33:31.785 [5327] dbg: bayes: can't use estimation method for expiry, unexpected result, calculating optimal atime delta (first pass)</div>

<div>05:33:31 May 22 05:33:31.785 [5327] dbg: bayes: expiry max exponent: 9</div></div>

<div> </div>

<div>     Stop at here ,and the MailScanner process occupancy CPU 100%, then 

after 30 seconds(because i set <span style="FONT-STYLE: italic">SpamAssassin Timeout = 30</span> ), the log will go 

on:</div>

<div> </div>

<div>

<div>05:34:45 May 22 05:34:45.809 [5330] dbg: dns: name server: 10.145.199.100, LocalAddr: 0.0.0.0</div>

<div>05:34:45 May 22 05:34:45.810 [5330] dbg: dns: resolver socket rx buffer size is 129024 bytes</div>

<div>05:34:45 May 22 05:34:45.810 [5330] dbg: config: time limit 300.0 s</div>

<div>05:34:45 May 22 05:34:45.812 [5330] dbg: message: main message type: multipart/mixed</div>

<div>05:34:45 May 22 05:34:45.812 [5330] dbg: message: ---- MIME PARSER START ----</div>

<div>05:34:45 May 22 05:34:45.813 [5330] dbg: message: parsing multipart, got boundary: part_60947f67_06c3_40e0_b324_b2bcc46f02c2</div></div>

<div>...............................</div>

<div> </div>

<div>    I don't know why and how to fix it.And i found when i run</div>

<div> </div>

<div>#MailScanner --debug --debug-sa </div>

<div> </div>

<div>   The MailScanner process will release resources after 30 seconds,when i 

run(i set <span style="FONT-STYLE: italic">Max Children = 5</span>)</div>

<div>#service MailScanner start</div>

<div> </div>

<div>   The MailScanner process which occupancy CPU 100% will not release 

resources .....And after a few minutes,maybe more MailScanner process will 

occupancy resources ,and after all the system is hung.I even set  <span style="FONT-STYLE: italic">SpamAssassin Timeout = 10</span> ,but can't fix 

either.</div>

<div> </div>

<div>   So,are there any friends know how to fix this problem? Thx!</div><br><br>---------------------------------------<br><font size="2"><a href="http://mail.21cn.com/m/21cn/index.html " target="_blank">21CN手机邮Android客户端,邮件随身享! </a><br></font></dongwind@21cn.com><br><br>---------------------------------------<br><font size=2><a href="http://mail.21cn.com/m/21cn/index.html " target="_blank">21CN手机邮Android客户端,邮件随身享! </a><br></font>