Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
postfix, amavis-new, spamd performance
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
carpman
Advocate
Advocate


Joined: 20 Jun 2002
Posts: 2202
Location: London - UK

PostPosted: Sun Jul 13, 2008 9:40 am    Post subject: postfix, amavis-new, spamd performance Reply with quote

Hello, a while back i was trying to get most out of mail server but consensus was that server was under powered, well now i have a Dual 2.8 xeon 2.5gb ram soon to be 4gb and want to get the most out of it.

The problem is that mail can still take about 10 secs to be scanned?

The server at high use only uses about 600mb ram so want to be able to use the memory and cpu power to improve this, any and all suggestions welcome.


i have set spamd options to:

Code:

SPAMD_OPTS="-m 20  -c -H"

SPAMD_NICELEVEL=8


cheers
_________________
Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb
Back to top
View user's profile Send private message
ceicke
n00b
n00b


Joined: 20 Jul 2006
Posts: 23
Location: DE, Hamburg

PostPosted: Mon Jul 14, 2008 10:17 am    Post subject: Reply with quote

I don't know what

Code:
SPAMD_NICELEVEL


exactly does, but setting it to a positive value will decrease it's priority. Nice vaules are raning from -20 (highes priority) to 19 (lowest priority), so setting it to 8 will give it lower priority than most of the other processess (having 0 as default). I recommend not getting below -4, that's the nice value for the udevd daemon and that really should have some priority.

Other than that, I think SPAMD only check inside it's temp folder periodically for new messages, for my mail setup it's fine, if users receive their mail 10 seconds later or earlier doesn't really matter, if messages are really that important, don't use e-mail ;-)

Christoph
Back to top
View user's profile Send private message
carpman
Advocate
Advocate


Joined: 20 Jun 2002
Posts: 2202
Location: London - UK

PostPosted: Mon Jul 14, 2008 4:05 pm    Post subject: Reply with quote

ceicke wrote:
I don't know what

Code:
SPAMD_NICELEVEL


exactly does, but setting it to a positive value will decrease it's priority. Nice vaules are raning from -20 (highes priority) to 19 (lowest priority), so setting it to 8 will give it lower priority than most of the other processess (having 0 as default). I recommend not getting below -4, that's the nice value for the udevd daemon and that really should have some priority.

Other than that, I think SPAMD only check inside it's temp folder periodically for new messages, for my mail setup it's fine, if users receive their mail 10 seconds later or earlier doesn't really matter, if messages are really that important, don't use e-mail ;-)

Christoph



Thanks for info on nice, the 10 sec may not sound like a lot but if you have few thousand mails in que it matters. should be around 2/3 secs
_________________
Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Tue Jul 15, 2008 4:24 pm    Post subject: Reply with quote

As usual I'd say dump amavisd-new and SA in favour of DSPAM and ClamAV.

Otherwise there is an extensive performance readme with amavisd-new that seems to cover all your options.

http://www.ijs.si/software/amavisd/README.performance.txt
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Sun Aug 03, 2008 1:56 pm    Post subject: Reply with quote

Couple of reasons why amavisd-new would be slow comes to me mind:

1) You have use_bayes enabled in SA configuration and you are using the default backend (BerkeleyDB) for bayes data. At least without some DB_CONFIG tuning that is quite a bottleneck, if you have a busy mail server with dozens of incoming messages per second or so.

Bayes/autowhitelist can also became slow if you are using MySQL + InnoDB as a backend for them, as amavisd-new/SA seems to perform lots of COUNT(*) queries, which is very slow with InnoDB.

2) External tests (pyzor, razor, dcc) are enabled. Waiting for their results will usually take couple of seconds.
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Sun Aug 03, 2008 3:56 pm    Post subject: Reply with quote

If you set
Code:
/etc/postfix/master.cf:
    smtp      inet  n       -       n       -       -       smtpd -v -v
 
in master.cf and check the mail.log, maybe there is some clue about a config hickup.
I run a similar mailserver on an old athlon 1.3G - 256 ram, and mail.log reports 1-2 second delivery, most of which is in clam through amavis.
Also is your kernel set with
Code:
Preemptible Kernel (server)
This makes a big difference too.
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Sun Aug 03, 2008 6:09 pm    Post subject: Reply with quote

If you want speed, then get rid of the interpreted stuff. Amavis is written in Perl and so is SpamAssassin. Both of them for sure are not the fastest in their class.

I know that now all the SA users will jump up and down and tell me that SA is fast if you do this and that. Maybe. But a content filter written in Perl will hardly beat one written in C. Even if you take all the external lookups out of SA it is slower then for example DSPAM. On the same hardware I normally count how many mails per second get tagged by DSPAM and I count how many seconds it takes for SA to tag a mail. That's a difference. A huge one. On one of my slow systems I tag up to 4 messages a second with DSPAM while it takes 5 and more seconds for SA to tag the same message.

And the same goes out for CRM114 or OSBF-Lua. They are blazing fast compared to SA.

If you are into tagging speed, then consider moving away from SA or scale up your hardware. Don't get me wrong. SA is good and so is Amavis. Both of them do their job. Speed is just not one of their qualities. Not because the product is bad but because the language they are written in is not as fast as C or C++.


// SteveB
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Mon Aug 04, 2008 12:47 am    Post subject: Reply with quote

Yep that sounds great SteveB.
My Kolab server runs SA by default, but there seems to be work in progress to get DSPAM running in Kolab. There is a Gentoo-wiki about converting to DSPAM, except the templates link leads to nowhere.
I shall have to dig deeper.
Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum