On Tue, 2014-04-22 at 22:31 +0300, Nick I wrote:
> I use SpamAssassin version 3.3.1 running on Perl version 5.10.1,
> amavisd-new-2.8.0-8.el6 as before-queue filter.
> Today for unknown reason i noticed high load on my server. Mail flow
> is as usual. About 8k in hour checked by amavisd.
> 
> Here is timing from amavis. tests_pri_0 is around 90% all the time :
> amavis[26002]: (26002-05) TIMING-SA total 759 ms - parse: 1.92 (0.3%),
> extract_message_metadata: 31 (4.1%), get_uri_detail_list: 6 (0.8%),
> tests_pri_-1000: 17 (2.2%), tests_pri_-950: 0.93 (0.1%),
> tests_pri_-900: 1.00 (0.1%), tests_pri_-400: 0.79 (0.1%), tests_pri_0:
> 668 (88.0%), check_dkim_signature: 9 (1.2%), check_spf: 364 (47.9%),
> poll_dns_idle: 338 (44.5%), tests_pri_500: 7 (1.0%), get_report: 0.99
> (0.1%)
> 
> In my another test i see async completed from 0.016 s till 0.174 s.
> 
> How can i disable/speed up tests_pri_0 ?
> What is inside tests_pri_0?

The letter question better be raised before asking how to *disable*
something... ;)

I'm not entirely sure about that amavis log-line, but it most likely
maps to the SA priorities rules are run at. Lower (including negative)
priorities are run prior to higher ones, with 0 being the default
priority level. Thus, this also is the priority of the bulk of the regex
based, CPU-bound general rules.

(a) Check your logs, if there is an sa-update run with a close timely
relation to the increase of CPU load. Both SA update channels, as well
as any third-party update channel (if any).

(b) Carefully review all your custom rules. Recent changes need special
attention.

Even if (in both cases) no changes correlate with the time of load
increase, it still might be a regex based rule in backtrace hell -- now
tripping on a pattern not observed in previous mail flow.


FWIW, custom rules with runaway regex patterns usually is the culprit
for such behavior. Stock SA update channel rules are unlikely, unless
others observe the same load increase.


-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}

Reply via email to