Sendmail CPU Load average Config QUEUE REFUSE DELAY

因為Server不單只跑Sendmail,CPU Load易高過預設值,即造成進來的mail connecting被Refuse,
信件因而被Queue住,容易造成信件Delay,所以Tunning Sendmail Config sendmail.cf .

If CPU Load is over 10 , Sendmail will QUEUE REFUSE DELAY incoming mail .
So we need to tunning Sendmail config , reduces mail delay problem.

data from:http://techgurulive.com/2008/09/15/sendmail-how-to-queue-mails-based-server-load-average/

There has been a lot of web debates and arguments which STMP email server works better, safer and faster. Not to discredit any other SMTP armies on the field, but I do often hear people debating about how difficult for them to configure Sendmail on time. Probably sendmail should be repackaged with a little teaspoon drop of sweet patience into it, so those mingling crowd could can get the taste better than they used to have.

In reality Sendmail is very easy to configure and flexible. Sendmail growth continuous to evolve as the crowd needs continue on demanding. Have you ever heard of Sendmail Engineer job position that only works with Sendmail setup and configuration? Just imagine what kind of sendmail job this sendmail engineer is usually doing.

Here are a few sendmail configuration tweaks that you can play with on queueing up incoming and new SMTP connection based on server’s current load average value.

Sendmail Directive Configurations

Most sendmail directives does not come with its default sendmail rpm installation. Here are a few of sendmail directives that you could manage to control, delay and queue incoming SMTP connections based on current server load average.

Sendmail directive: confQUEUE_LA

One trick you can play along with sendmail configuration setup is on how you could tweak sendmail to queue incoming mails and put on hold, rather than queue them up immediately for delivery if a certain sendmail rules is met. The below sendmail directive considers current server’s load average value as a basis to put new and incoming emails on hold.

define(`confQUEUE_LA’, `10′)dnl

If the server’s load average value increases to or more than 10, then sendmail is then instructed to put all incoming emails on queue for hold, instead of delivering all new incoming emails for delivery. The sendmail directive is active until the server’s load average value decreases down below 10.

Sendmail directive: confREFUSE_LA

Now, if you want to tweak sendmail to stop accepting any new incoming SMTP connections and mails based on server load average value, you could make use of the below sendmail configuration directive as shown below

define(`confREFUSE_LA’, `15′)dnl

The above instructs sendmail to completely stop accepting new and rejecting incoming SMTP connections if and only the current server load average reaches and stays 15 or above.

Sendmail directive: confDELAY_LA
Now, to throttle SMTP connections, we can make use of the below sendmail directive

define(`confDELAY_LA’, `5′)dnl

The server load average value of 5 is a sendmail directive trigger point at which sendmail is instructed to sleep for one second on most SMTP commands and before accepting SMTP connections again. 0 means no limit.
When modifying sendmail configuration file /etc/mail/sendmail.mc, always remember to restart sendmail service to take effect the new changes from sendmail directives.

To recompile sendmail.mc sendmail configuration file

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

To restart sendmail service

# service sendmail restart

To monitor sendmail logs

# tail -f /var/log/maillog

To monitor queued mails

# mailq

There are a lot more sendmail directives and M4 sendmail variables that are just waiting to be configured and changed.

Posted in 標籤: | 0 意見