UDP performance

Serge Orlov Serge.Orlov at gmail.com
Thu Apr 20 03:54:35 EDT 2006


Paul Sijben wrote:
> I am stumped by the following problem. I have a large multi-threaded
> server accepting communications on one UDP port (chosen for its supposed
> speed).
>
> I have been profiling the code and found that the UDP communication is
> my biggest drain on performance! Communication where the client and the
> server are on the same machine still takes 300ms or sometimes much more
> per packet on an Athlon64 3000+ running Linux (Fedora Core 5 x64).

[snip]

> buf, address = socket.recvfrom(8192)

I'm not an expert here, but I AFAIK UDP packet size should be kept
below 512 bytes otherwise it can cause fragmentation and hence all the
slow stuff like acknoledgements, timeouts, etc...




More information about the Python-list mailing list