Network performance

Roland Hedberg roland.hedberg at adm.umu.se
Tue Aug 23 03:43:55 EDT 2005


Hi!

I need a fast protocol to use between a client and a server, both  
sides written i Python.

What the protocol has to accomplish is extremely simple; the client  
sends a number of lines (actually a RDF) and the server accepts or  
rejects the packet. That's all !

Now, presently I'm using Twisted and XMLRPC ( why so is a long  
history which I will not go into here) and that is a bit to slow for  
my needs. On my present setup it takes close to 200 ms to perform one  
transfer. But since that includes setting up and tearing  down the  
connection I thought I'd try doing something simpler so I wrote a  
server and a client using socket.

The client sends a number of lines (each ending with \n) and ends one  
set of lines with a empty line.
When the client sends a line with only a "." it means "I'm done close  
the connection".

Letting the client open the connection and sending a number of sets I  
was surprised to find that the performance was equal to what Twisted/ 
XMLRPC did. Around 200 ms per set, not significantly less.

So what can be done to speed up things or is Python incapable of  
supporting fast networking (just a teaser).

-- Roland 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: udsrecv.py
Type: text/x-python-script
Size: 633 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050823/0f451718/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: udscli.py
Type: text/x-python-script
Size: 1067 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050823/0f451718/attachment-0001.bin>
-------------- next part --------------



More information about the Python-list mailing list