I recently upgraded from SA 2.64 to 3.1.0 and one thing I've noticed is bayes
operations are inordinately slower than they used to be. Especially expiry runs,
which often take in excess of 15 minutes to complete.

I've tried changing the lock_method to flock, but things are still slow.

Even just doing a --dump magic seems to take a strangely long time:

[EMAIL PROTECTED] root]# time sa-learn --dump magic
0.000          0          3          0  non-token data: bayes db version
0.000          0     780736          0  non-token data: nspam
0.000          0      91958          0  non-token data: nham
0.000          0     178712          0  non-token data: ntokens
0.000          0 1132316197          0  non-token data: oldest atime
0.000          0 1132597905          0  non-token data: newest atime
0.000          0 1132597952          0  non-token data: last journal sync atime
0.000          0 1132592420          0  non-token data: last expiry atime
0.000          0     212693          0  non-token data: last expire atime delta
0.000          0      63586          0  non-token data: last expire reduction 
count

real    0m10.568s
user    0m9.410s
sys     0m0.370s

[EMAIL PROTECTED] root]# time sa-learn --dump magic

<snip>
real    0m11.954s
user    0m5.270s
sys     0m0.160s

Notes:

I do have a larger bayes token count than default, 250k, but under 2.64 I was
running even more with 300k tokens. I tried switching to using 250 to see if I
could speed up expiry a bit.

bayes_expiry_max_db_size 250000
#bayes_expiry_max_db_size 300000

The box all this is running on is a Intel celeron 2ghz with 512mb of ram.

The box doesn't look to be resource starved. Swap usage is very mild and there's
more free ram than swap used. Load averages and CPU utilizations all seem quite
reasonable.


 13:48:39  up 42 days,  6:57,  1 user,  load average: 0.15, 0.50, 0.56
81 processes: 79 sleeping, 2 running, 0 zombie, 0 stopped
CPU states:  12.8% user   2.3% system   0.0% nice   0.0% iowait  84.7% idle
Mem:   514544k av,  442556k used,   71988k free,       0k shrd,   50976k buff
       120436k active,             299564k inactive
Swap: 1052216k av,   42312k used, 1009904k free                   85552k cached

In the past 24 hours mrtg reports load average statistics of:
Max  Load:      1.2                     
Average  Load:          0.3                     
Current  Load:          0.5

And CPU utilization:

Max  CPU Utilization (total):   61.0 percent                    
Average  CPU Utilization (total):       16.0 percent                    
Current  CPU Utilization (total):       19.0 percent


And ram:
Max  RAM used including cache:          485.0 M  RAM Used               
Average  RAM used including cache:      438.0 M  RAM Used               
Current  RAM used including cache:      419.0 M  RAM Used

Max  RAM used excluding cache:          308.0 M  RAM Used               
Average  RAM used excluding cache:      265.0 M  RAM Used               
Current  RAM used excluding cache:      265.0 M  RAM Used



Anyone have any suggestions for tuning bayes on a simple single-box single
sitewide-bayes setup (using MailScanner with no bayes_path statements, so all
bayes is in the homedir of the user specified by MailScanner's "Run As User"
option.)









Reply via email to