Linux – Question on SendMail daemon actions when load average is too high

dsnlinuxload-averagesendmailsmtp

My sendmail server started rejecting connections because load average was too high (due to a spam issue that has since been resolved).

Error was: sendmail[13400]: rejecting connections on daemon MTA: load average: 50

I'd like to understand this behavior better though.

  • Where is this threshold set?
  • What does "load average" mean?
  • How often is load average calculated?
  • Is there a way to proactively monitor this? Or becoming alerted when load average approaches a high value? Obviously sendmail will give a 4.0.0 class dsn to the connecting MTA but I was homing for some sort of alert mechanism.

Thanks,

M


Hi Guys,

I thought I'd bump this one more time as I saw it come up again. The issue I'm now seeing is that messages that are queued due to exceeding load average don't get resent later (even after performance returns to acceptable levels. Any idea why this could be?

Thanks,

M

Best Answer

The system load average is a performance metric used to represent how much work a system is doing. When you log into your mail server (assuming a UNIX type system), you can type the uptime command to see the load average over the last minute, 5 minutes, and 15 minutes. Here's an example from a production server:

sh$ uptime
10:53am  up 248 day(s), 36 min(s),  12 users,  load average: 0.28, 0.29, 0.30

So the 5 minute load average is 0.28, the load average for the last 5 minutes is 0.29, etc. In this case you can see that the system's load is lowering slightly over time.

As a rule of thumb, you will want to keep server load below 1. But this isn't necessarily true in all cases. If you watch your server(s) for a while you will start to see what a reasonable load is. This is probably the easiest way to understand it, by just watching it in the real world. That said, how the load average is calculated is actually rather complex, but if you're interested I recommend checking out the following article on how Linux calculates it:

http://www.linuxjournal.com/article/9001

Now back to sendmail. Sendmail can be configured to only queue messages, or to flat out reject messages, when the load average (LA) gets too high. The idea is that this will keep sendmail from taking your whole system down. If it's refusing connections too early, there are two settings you can look at in sendmail.cf:

O QueueLA=8 - load average at which Sendmail queues new messages

O RefuseLA=12 - load average at which Sendmail rejects connections

Googling on the above returned a page with some instructions on how to change these parameters (when using M4 macros) which might be helpful:

http://www.revsys.com/writings/quicktips/sendmail-mc.html