[erlang-questions] gen_tcp receving slow

igwan igwan@REDACTED
Tue Sep 25 01:05:09 CEST 2007

Hi list !

I'm writing a HTTP server and while doing some benchmarks on big 
POST/PUT requests (file uploads), I was a little surprised with the 
results. I bypassed my parsing code, just to be sure, and tested on 
Linux and Win32 with R11B-5, all this on the loopback interface. The 
incoming data throughput doesn't get over 5 MB/s or so during the 
transfer while my Intel 2Ghz Intel CPU is 100 % busy with "werl". On my 
linux box, it's around 2,5MB/s on a 2Ghz Via CPU, again 100% busy. I'm 
using [{active, true}, {packet, raw}, binary] as inet options.
ETop doesn't show any message queue growing, they're all zero during the 
receiving. The CPU load that it displays, unlike the one indicated by 
'top', stays very low, 0 or 1 most of the time, and no more than 15 
during the whole process. Where's the CPU time going ?

As I have Yaws installed on my linux box, I did some tests, in case I 
was missing some obvious inet option that the guy who wrote such a nice 
beast as Yaws would undoubtly have got right. GETting a file using Curl 
is fast : 32MB/s ...  POSTing or PUTing a file goes no faster than 2MB/s 
at 100% CPU load.

Have you experienced such **asymmetry on TCP data transfers ? Any ideas 
about where it comes from ?

Thanks for your help,


More information about the erlang-questions mailing list