[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Load-average based SMTP receiver blocking ?



rsalz:
> On the other hand, sendmail went through a big learning curve trying
> to decide of never accepting, just doing a close(), or sending a reject
> message is the right thing to do.  A lot of it depended on what other
> implementations did.

the problem is the sender has unpredictable retry behavior, right?

how about, instead of dropping or rejecting the connection, hold on to
the connection but sleep until the load avg drops.  the advantage is
you keep greater control of incoming load.  (provided the sender
doesn't timeout idle connections to quickly.)

the disad is sleeping connections still consume resources.  but for
something like smtpserver, an incoming pending connection doesn't use
much memory; the main cost is it consumes a filedescriptor and system
table space.  so when you hit some fd limit, start dropping pending
connections LRU.

for general use, you can write a small front-end that does this, the
way tcp_wrapper works.  but I guess ideally it should be integrated
with inetd, to minimize the system cost per connection.
--