[tpop3d-discuss]tpop unable to handle load

Chris Lightfoot chris at ex-parrot.com
Wed, 8 Sep 2004 22:51:26 +0100


On Wed, Sep 08, 2004 at 02:24:49PM -0700, Richard Stockton wrote:
> Hi there,
> 
> I work for an ISP that handles about 3 million emails per day.
> We use postfix for that (works great!).
> 
> We also handle pop3 for about 5500 users, and we have been using
> tpop3d (version 1.5.3) for that.  However, it doesn't seem to be
> keeping up with the load.  When it gets to 20 or so people popping
> at the same time, it starts complaining and dropping connections.
> I have upped the max children to 100 in both main.c and netloop.c,
> but I still get a LOT of these messages;

ok. max-children sets the number of sessions which may be
accessing a mailbox at any one time (access to mailboxes
is done by child processes). A further 2 × max-children
may be awaiting authentication at any time. This message:

> Sep  8 13:42:56 mail tpop3d[94605]: listeners_post_select: rejected 
> connection from nnn.nnn.nnn.nnn to local address nnn.nnn.nnn.nnn:110 owing 
> to high load

occurs when either (a) the number of child processes grows
to max-children, or (b) the number of unauthenticated
connections grows to 2 × max-children. You get a `rejected
login owing to high load' message if a user connects but
by the time they log in, there are already max-children
child processes running.

> Should tpop3d be able to handle 20+ simultaneous connections?

Yes, on the hardware you have.

> If so, what am I doing wrong?

Are you sure that it's only handling c. 20 connections?
What does lsof give? What timeout have you set? Is it
possible that you have lots of quiescent connections
waiting to be timed out?


Another quick check you can do (on a test server,
probably...):

    for i in `seq 1 N` ; do nc localhost 110 & done

where N = 2 × max-children + 1

this should give you exactly 2 × max-children `connected'
log messages, and exactly one `rejected connection...' log
message.

Similarly, with N = max-children + 1, you should be able
to try

    for i in `seq 1 N` ; do echo -e 'USER foo\nPASS bar' | nc localhost 110 & done

and get max-children successful login messages and one
`rejected login' message.

(nc is `netcat', a trivial but moderately useful if
poorly-written utility.)

-- 
`There are three principal ways to lose money: wine, women, and engineers.
 While the first two are more pleasant, the third is by far the more certain.'
 (Baron Rothschild, ca. 1800)