TCP stack throughput

Javier París Fernández <>
Tue Jul 19 19:39:12 CEST 2005


Hi,

Ok, a bit late O:)

I modified the files slightly, because out TCP/IP stack works
with a passive model (the client must make the reads explicitly).
The files can be downloaded from

http://www.lfcia.org/~paris/fac.erl
http://www.lfcia.org/~paris/tcp_server.erl

To take away the cost of the factorial, I made all the test computing
the factorial of 1.

I observed several funny things. The time spent processing the
connections seems to go up exponentially, but it is not limited
by cpu, which was always under 50%. I don't know what is throttling it.

When I trid with 5000 connections, the logs started to show retransmissions,
so I think it is probably related to some buffering limit with
the socket. This obviously skyrocketed the total processing time.

The total processing time for the tests was:
500 in 0.6 seconds
1000 in 1.7 seconds
2000 in 6.2 seconds
5000 was still closing connections after 3 minutes

There are tcpdump logs in 
http://www.lfcia.org/~paris/dump500.gz
http://www.lfcia.org/~paris/dump1000.gz
http://www.lfcia.org/~paris/dump2000.gz
http://www.lfcia.org/~paris/dump5000.gz

I think it would be interesting to find what is the limiting the stack
here, and why there are dropped packets, as I think it should be 
possible to get better performance. However, I had not made a test
similar to this, so connection opening and closing is one of the things 
that are not optimized in the stack.

Regards,
Javier.




More information about the erlang-questions mailing list