Re: Possible problem with ACCEPT/CONNECT in

From: Julian Anastasov (uli@linux.tu-varna.acad.bg)
Date: Fri Apr 07 2000 - 15:13:10 EST


        Hello,

On Fri, 7 Apr 2000, Peter Zaitsev wrote:

> Resently I wrote to this list about problem with strange slowdown on network
> connections. Now I have done some investigations and must say the problem
> really exists and repeatable !. Both 2.2 and 2.3 kernels are atthected in
> SMP and non-SMP configuration.
> The problem is then many clients are trying to connect the same port, they
> sometimes get locked for a long time even then CPU usage on server is low
> and it is able to do needed number of accepts in a time.
> The problem persists the client and server are on the same or on different
> machines, and even then number of server processes doing accept() is grater
> then the number of clients running.

        Try with no more than 128 clients.

> The next strange the times taken by connect() - if it does not pass
> momentaly it gots locked for 3 9 21 45 ... seconds.
>

        Read Documentation/proc.txt. Look for tcp_max_syn_backlog. Try to
keep it > number of processes in your client.

        Try to set /proc/sys/net/ipv4/tcp_syn_retries to 2 for the test
only. What is the longest "locked" time? These seconds are the interval
used between the SYN packets started from the client. Are your SYN packets
dropped in the server because the backlog is full (def=128). Try with
120 clients to flood your server. 3 seconds is initial timeout value which
is multiplied by 2 up to 2 minutes timeout, 3+6=9, 9+12=21, you can
continue, I think.

        You can try to enable the SYN cookies support and to set
/proc/sys/net/ipv4/tcp_syncookies to 1.

        For all these flags you can read in the docs.

        What about adding "while (read(i,any_buf,any_size)>0){}"
just before the close(i) in your client. You overloaded your server
with clients more than its backlog size. Your server can't accept such
number of connections. The client's SYNs are dropped.

        Is the problem near these assumptions.

Regards

--
Julian Anastasov <uli@linux.tu-varna.acad.bg>

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:18 EST