[Python-talk] Python socket speed ups?

bruce.labitt at autoliv.com bruce.labitt at autoliv.com
Thu Oct 1 11:46:03 EDT 2009


Mark Mc Mahon <mtnbikingmark at gmail.com> wrote on 09/30/2009 07:54:34 PM:

> Hi,
> 
> What OS are you on?

Linux - Ubuntu 8.10

> 
> I remember seeing a thread on python-dev mailing list recently about 
> python httplib on windows slowness (though I don't know if the problem
> was httplib or sockets).
> 
> There isn't a conclusion as such...
> http://mail.python.org/pipermail/python-dev/2009-August/091125.html
> http://mail.python.org/pipermail/python-dev/2009-September/091581.html
> (maybe here - but I haven't read the whole thread)
> 
> Thanks
>   Mark

> On Thu, Oct 1, 2009 at 5:21 AM, <bruce.labitt at autoliv.com> wrote:
> As some of list may know, I've been working on a client-server 
application
> using python.  I prototyped the whole system, sockets and all, using
> python.  Since then, I have rewritten the server in C/C++ to exploit the
> very fast FFT algorithm in FFTW.  Although the profiling is incomplete, 
it
> is now indicating that the client, which is written entirely in python
> 2.5.2, is likely the bottleneck.  ( 66% of run time is waiting for the
> data transfer )
> 
> It is appearing that the server is waiting for the client to send the
> data.  I'm using socket.sendall.  Is there something that can be done to
> boost the speed of the send?  The data is present, it is just taking a
> long time to be sent - much longer than the network speed would 
indicate.
> 
> The server is receiving 80,673,600 bytes in ~4.575 seconds, which works
> out to ~141E6 bits/sec.  Very respectable for most, but not quite good
> enough for the application.  I'd like to see 2-3x that.  This is on a
> 1Gbit link that is about 50m long using CAT6 cable.
> 
> Is there a way to speed up the send?  OS network buffers?  Python speed
> up?  Call sockets in C?
> 
> Thanks for your suggestions!  I really appreciate them.
> 
> 
> Oh, yeah, the list is too quiet :P
> 


******************************
Neither the footer nor anything else in this E-mail is intended to or constitutes an <br>electronic signature and/or legally binding agreement in the absence of an <br>express statement or Autoliv policy and/or procedure to the contrary.<br>This E-mail and any attachments hereto are Autoliv property and may contain legally <br>privileged, confidential and/or proprietary information.<br>The recipient of this E-mail is prohibited from distributing, copying, forwarding or in any way <br>disseminating any material contained within this E-mail without prior written <br>permission from the author. If you receive this E-mail in error, please <br>immediately notify the author and delete this E-mail.  Autoliv disclaims all <br>responsibility and liability for the consequences of any person who fails to <br>abide by the terms herein. <br>
******************************


More information about the Python-talk mailing list