[exim] Connections refused during high load averages - FreeB…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Juha Saarinen
Ημερομηνία:  
Προς: Exim Users Mailing List
Αντικείμενο: [exim] Connections refused during high load averages - FreeBSD 5.3beta
Hope this isn't going to be a "Doctor, doctor, it hurts when I bang my
head against the well" type of query, but... I've noticed on FreeBSD
5.3beta that Exim refuses connections if load averages shoot up:

2004-09-22 10:24:41 Connection from [202.150.102.34] refused: load
average = 24.96
2004-09-22 10:24:52 Connection from [202.150.102.34] refused: load
average = 25.07
2004-09-22 10:25:17 Connection from [204.127.198.39] refused: load
average = 24.63
2004-09-22 10:29:02 Connection from [202.150.102.34] refused: load
average = 12.05

Had a look at daemon.c below, and kept an eye on the load averages
with top and systat, and it seems as soon as the load goes over 10,
Exim refuses connections.

Unscientific testing of different apps indicates that the system is as
responsible as under lighter loads as under ~20-25 loads so I wonder
if Exim is "overreacting" here?

The box is a 3.06GHz P4, 512MB RAM and Hyperthreading enabled. A 'make
-j4 buildworld' for instance is enough to push load averages over 10
and stop Exim from accepting connections.

Sample output from top with 'make -j10' running:

last pid: 2651; load averages: 15.92, 20.56, 16.91 up 10+17:57:12 10:49:50
113 processes: 8 running, 105 sleeping
CPU states: 89.9% user, 0.0% nice, 7.6% system, 2.5% interrupt, 0.0% idle
Mem: 247M Active, 63M Inact, 105M Wired, 26M Cache, 60M Buf, 53M Free
Swap: 998M Total, 57M Used, 941M Free, 5% Inuse, 16K In

smtp_load_reserve seems to be set in globals.c:

int     smtp_load_reserve      = -1;


/* If a load limit above which only reserved hosts are acceptable is defined,
get the load average here, and if there are in fact no reserved hosts, do
the test right away (saves a fork). If there are hosts, do the check in the
subprocess because it might take time. */

if (smtp_load_reserve >= 0)
  {
  load_average = os_getloadavg();
  if (smtp_reserve_hosts == NULL && load_average > smtp_load_reserve)
    {
    DEBUG(D_any) debug_printf("rejecting SMTP connection: load average
= %.2f\n",
      (double)load_average/1000.0);
    smtp_printf("421 Too much load; please try again later.\r\n");
    log_write(L_connection_reject,
              LOG_MAIN, "Connection from %s refused: load average = %.2f",
      whofrom, (double)load_average/1000.0);
    goto ERROR_RETURN;
    }
  }



--

Juha