You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Justin Mason <jm...@jmason.org> on 2007/03/12 13:24:01 UTC

Re: sa-compile usage questions

snowcrash+spamassassin writes:
> some questions about sa-compile usage:
> 
> (1) how do we verify that the compiled rules are working? is a
> 'healthy' --lint sufficient?

Well, it's a bit tricky -- run a --lint, and look out for lines like this:

[15144] dbg: rules: running one_line_body tests; score so far=0
[15144] dbg: zoom: run_body_fast_scan for body_0 start
[15144] dbg: zoom: run_body_fast_scan for body_0 done

note btw that you need to have this line uncommented in v320.pre:

  loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody

> (2) how do/should we meaure the improved (hopefully) performance due
> to the compiled rules?

Compare the scan times for a collection of ham and spam mails.  they
should be faster ;)

> (3) do compiled rules automatically take precedence over uncompiled
> rules? or, must we remove the uncompiled rules from the rule path?
> i'm guessing it's done auto-magically ...

It's automatic.

> (4) should (must?) we run sa-compile at every rule update?  e.g., if
> we're sa-update'ing once/hr, running sa-compile hourly is more than a
> bit cpu intensive.
> 
> (5) does sa-compile detect diffs/changes between runs and only compile
> changes? or does it recompile ALL available rules each time?

It'll always recompile fully.
However sa-update will not exit with status "0" unless it downloads
an update, so you can do:

  sudo sa-update && sudo sa-compile && sudo /etc/init.d/spamassassin reload

--j.

Re: sa-compile usage questions

Posted by snowcrash+spamassassin <sc...@gmail.com>.
> > (1) how do we verify that the compiled rules are working? is a
> > 'healthy' --lint sufficient?
>
> Well, it's a bit tricky -- run a --lint, and look out for lines like this:
>
> [15144] dbg: rules: running one_line_body tests; score so far=0
> [15144] dbg: zoom: run_body_fast_scan for body_0 start
> [15144] dbg: zoom: run_body_fast_scan for body_0 done

after a,

  spamassassin --lint --nocreate-prefs --debug >& out.txt

checking,

 grep one_line_body out.txt
   665  [6498] dbg: rules: running one_line_body tests; score so far=0
   677  [6498] dbg: rules: running one_line_body tests; score so far=0
   685  [6498] dbg: rules: running one_line_body tests; score so far=0
   693  [6498] dbg: rules: running one_line_body tests; score so far=0
   725  [6498] dbg: rules: running one_line_body tests; score so far=0
   798  [6498] dbg: rules: running one_line_body tests; score so far=2.75
   833  [6498] dbg: rules: running one_line_body tests; score so far=5.225
   845  [6498] dbg: rules: running one_line_body tests; score so far=5.225

 grep fast out.txt
   666  [6498] dbg: plugin:
Mail::SpamAssassin::Plugin::Rule2XSBody=HASH(0x1f34428) implements
'run_body_fast_scan', priority 0
   726  [6498] dbg: zoom: run_body_fast_scan for body_0 start
   727  [6498] dbg: zoom: run_body_fast_scan for body_0 done
   799  [6498] dbg: zoom: run_body_fast_scan for body_500 start
   800  [6498] dbg: zoom: run_body_fast_scan for body_500 done

out of 854 lines in "out.txt", is this _sufficient_ indication that
all's working ok?

> note btw that you need to have this line uncommented in v320.pre:
>   loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody

of course.

> > (2) how do/should we meaure the improved (hopefully) performance due
> > to the compiled rules?
>
> Compare the scan times for a collection of ham and spam mails.  they
> should be faster ;)

i.e., DIY -- nothing auto-magical. thanks.

> > (3) do compiled rules automatically take precedence over uncompiled
> > rules? or, must we remove the uncompiled rules from the rule path?
> > i'm guessing it's done auto-magically ...
>
> It's automatic.

ok. thanks.

> > (4) should (must?) we run sa-compile at every rule update?  e.g., if
> > we're sa-update'ing once/hr, running sa-compile hourly is more than a
> > bit cpu intensive.
> >
> > (5) does sa-compile detect diffs/changes between runs and only compile
> > changes? or does it recompile ALL available rules each time?
>
> It'll always recompile fully.
> However sa-update will not exit with status "0" unless it downloads
> an update, so you can do:
>
>   sudo sa-update && sudo sa-compile && sudo /etc/init.d/spamassassin reload

aha. that should work. thanks.