View previous topic :: View next topic |
Author |
Message |
carpman Advocate

Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sun Jul 13, 2008 9:40 am Post subject: postfix, amavis-new, spamd performance |
|
|
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 |
|
 |
ceicke n00b

Joined: 20 Jul 2006 Posts: 23 Location: DE, Hamburg
|
Posted: Mon Jul 14, 2008 10:17 am Post subject: |
|
|
I don't know what
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 |
|
 |
carpman Advocate

Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Mon Jul 14, 2008 4:05 pm Post subject: |
|
|
ceicke wrote: | I don't know what
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 |
|
 |
magic919 Advocate

Joined: 17 Jun 2005 Posts: 2182 Location: Berkshire, UK
|
|
Back to top |
|
 |
Janne Pikkarainen Veteran


Joined: 29 Jul 2003 Posts: 1143 Location: Helsinki, Finland
|
Posted: Sun Aug 03, 2008 1:56 pm Post subject: |
|
|
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 |
|
 |
notHerbert Advocate


Joined: 11 Mar 2008 Posts: 2228 Location: 45N 73W
|
Posted: Sun Aug 03, 2008 3:56 pm Post subject: |
|
|
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 |
|
 |
steveb Advocate


Joined: 18 Sep 2002 Posts: 4564
|
Posted: Sun Aug 03, 2008 6:09 pm Post subject: |
|
|
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 |
|
 |
notHerbert Advocate


Joined: 11 Mar 2008 Posts: 2228 Location: 45N 73W
|
Posted: Mon Aug 04, 2008 12:47 am Post subject: |
|
|
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 |
|
 |
|