UDP performance

Paul Sijben sijben at eemvalley.com
Thu Apr 20 04:10:06 EDT 2006


Serge Orlov wrote:
> 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...
> 
good point in general but in practice they are in this case. but this is
less of a problem on the loopback interface anyway.



More information about the Python-list mailing list