At 09:14 AM 3/16/99 +0000, Yusuf Goolamabbas wrote:
>Hi, I am currently using tcpserver on a Linux 2.0.36 box/RH 5.2 box
>I have setup tcpserver with a limit of 5 connections via -c5 and
>backlog of 1 with -b1
>
>However, when I start up the 7th and subsequent connection, I
>basically get held up waiting for the smtpgreeting string which will
>occur as soon as I close some other connection.

This is often a function of your OS. tcpserver is merely using 
listen/accept/connect and it relies on the OS to handle the cases where, eg, 
the backlog value in listen() is exceeded.

On some OSes, as I understand it, the listen() value uis silently ignored or 
constrained so the value you set via tcpserver may not be the actual value 
used by the OS.

>are in the ESTABLISHED state. If I were to increase concurrency limit
>to something higher, is there a possibility that the OS TCP tables
>might become full, with most entries primarily waiting for connections
>to complete.

In general, I would expect that you'd run out of other resources before 
running out of some OS table associated with the accept queue. Resources, 
such as memory or disk. I've always set concurrency based on have much of 
the main system resources I wanted to allocate to that particular service 
(disk, memory, CP, bandwidth).

In other words, set concurrency to values that make sense for the main 
resources you have and the amount of service you want to offer and the OS 
accept queue sizes are unlikely to be relevant.

> Would it be better to refuse connection ?

I'm not sure it's defined what happens when the backlog value is exceeded. 
Here's what Freebsd has on the listen() manpage:

*     If a connection request arrives with the queue
*     full the client may receive an error with an indication of ECONNREFUSED,
*     or, if the underlying protocol supports retransmission, the request may
*     be ignored so that retries may succeed.

Note the inconclusive use of "may". Check your Linux manpage to see what it 
says.

>Is there a patch to tcpserver which does something similar or this
>concept/idea is bogus :-)

I haven't looked lately, but I'd guess that sendmail is making the same 
system calls.


Regards.

Reply via email to