Question on SendMail daemon actions when load average is too high

20,345

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

Share:
20,345

Related videos on Youtube

Mike B
Author by

Mike B

Technology Enthusiast, Gamer, Sci-Fi Addict, and DIY-er in training. =)

Updated on September 17, 2022

Comments

  • Mike B
    Mike B almost 2 years

    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

  • Mike B
    Mike B almost 14 years
    BRILLIANT response. Thanks! Another quick question... what are the defaults? I didn't see that in the links nor could I find it online.
  • Deutsch
    Deutsch almost 14 years
    Good question! I wasn't sure off the top of my head, but my own googling lead me to the Sendmail m4 README.txt, which states that the default QueueLA is the number of processors on the server multiplied by 8, and the RefuseLA default is the number of processors multiplied by 12. (When you set them manually it just sets it to what you specify, no additional multiplication is done.) HTH. sendmail.org/m4/README.txt