Load Problem

Christopher Schanzle mailscanner at CAS.HOMELINUX.ORG
Fri May 28 20:18:20 IST 2004


Ricardo Bernardes wrote:

> Hello,
>
> i'm using RH8, ClamAv and MS on a PIV 2,8 box with 512 Mb of Ram.
>
> Whenever a user sends an heavy mail (e.g. about 6Mb) to all other
> users (we're about 130) my server takes a lot of time to go back to
> normal.
> the POP3 connections get very slow and some even time out; the SSH
> network (over LAN) connections times out
> after everyone downloads the e-mail, it goes back to normal
>
> any thoughts how to overpass this situation?
>
>
> thanks
> ricardo


Once again, basic troubleshooting applies.

It sounds like an email server issue rather than MailScanner issue.  Is
your POP server is the same box as the mailscanner/clamav box?

Is the sender sending a single message to many recipients, or sending
many (similar but separate) messages to each user?

If the former, what is your back-end email system?  If it's Cyrus
(highly recommended), enable single-instance message store.  If it's
not, consider switching to it using Simon Matter's RPM's.  By doing so,
if a user sends a message to N recipients, the data of the message gets
written once and for all other recipients, a hard link is made.  Note
this means you don't write N*(message-size) files.  Also note you'll
have to tweak your Cyrusv2 mailer options to accept more than the
default of 10 or so recipients per message.

The idea here is that if you use hard links, the message data is
identical for all users and refers to the same disk blocks and thus will
remain cached in RAM while your users download their copies.  Unlinking
the hard link (inode) is also much quicker than freeing all the disk
blocks plus the inode.

To help spread out the load, have your users poll for new mail no more
frequently than 5 minutes, preferably 10.  If they are impatient and
expecting new mail from someone, let them click on "get messages" manually.

When your user sends the mass mailing, run "vmstat 1" and carefully
study the output (are you swapping?  If so, get more RAM.)  Many pages
in/out?  Get more/faster disks and stripe them.  Use "iostat -x 1" to
also get more detailed information on disk utilization.  Could you
improve your filesystem performance?  E.g., mount the filesystem with
-noatime.  Switch filesystem types (e.g., ext2 -> some journaled
filesystem, such as Reiserfs [mount with -notail], which is very good
with small files).  Is your CPU idle time zero?  Get more/faster CPUs
(though 2.8 GHz P4 ought to be plenty for 120 people).  If you are
running out of CPU, look at the output of "top" to see what else might
be contending with it.  Consider running POP service at a higher "nice"
priority, or MailScanner + your MTA at a lower "nice" priority.

Is your network saturated?  The world should be all 100Mbit full duplex
switched, but you never know.  Try running "gkrellm" and watch your
network traffic volume (note it reports KB/sec, not Kb/sec, so on 100Mb,
expect 8-11 MB/sec max).  If you're saturating 100Mbit (highly doubt it
unless all the users are downloading in the same minute), move to
Gigabit on your server and make sure the traffic intelligently fans out
to switched ports to your users.

Finally, you have the option to Punt:  don't send large messages!  (Put
the attachment on a file or web server and send the users a link.)

Hope this helps,
Chris

-------------------------- MailScanner list ----------------------
To leave, send    leave mailscanner    to jiscmail at jiscmail.ac.uk
Before posting, please see the Most Asked Questions at
http://www.mailscanner.biz/maq/     and the archives at
http://www.jiscmail.ac.uk/lists/mailscanner.html



More information about the MailScanner mailing list