HTTP keep-alive performance

Discussion in 'Python' started by Manuel Metz, Mar 4, 2008.

  1. Manuel Metz

    Manuel Metz Guest

    Hi all,
    I tried to use the HTTP keep-alive (HTTP/1.1) mechanism for an xmlrpc
    server/client session. This worked fine, after I found out how to fix
    the client, see:
    http://mail.python.org/pipermail/python-list/2004-April/256360.html
    and also
    http://mail.python.org/pipermail/python-list/2007-May/442541.html


    Now, as I said, everything seems to work fine -- except: performance got
    very bad :-(

    So, I captured the TCP traffic with wireshark (both, server and client
    are running on the same machine, 'http://localhost', so its not the
    network). What I found out is the following:

    The first remote-call is executed very fast. Then the connection is kept
    open (I verified that it is closed for HTTP/1.0). But when it comes to
    the second call, the performance gets bad. The TCP ACK package is sent
    after ~40ms only, which took ~ < 1ms before for the first call, even for
    HTTP/1.1. Why is that?

    So this is a sketch of what's going on:

    client server
    ---------- ----------
    HEADER -->
    <-- ACK ~1ms
    CONTENT -->
    <-- ACK ~1ms
    <-- HEADER
    ACK --> ~1ms
    [...] response is submitted; connection is NOT closed [...]
    HEADER -->
    <-- ACK ~40ms
    CONTENT -->
    <-- ACK ~1ms
    <-- HEADER
    ACK --> ~40ms
    [...] response data is submitted

    It's just a rought timeline to show where the bottleneck is. Has anyone
    any idea why the acknowledgement messages take sooooo long to be sent???

    Manuel
    Manuel Metz, Mar 4, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luiz Alberto Gibson da Costa

    web chat development, http header connection: keep-alive

    Luiz Alberto Gibson da Costa, Aug 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    604
    Luiz Alberto Gibson da Costa
    Aug 6, 2003
  2. twscott
    Replies:
    1
    Views:
    5,041
  3. Herman

    Keep JVM alive with JNI

    Herman, May 24, 2004, in forum: Java
    Replies:
    6
    Views:
    1,107
    Herman
    May 27, 2004
  4. David Rasmussen

    HTTP Keep-Alive with urllib2

    David Rasmussen, Nov 14, 2005, in forum: Python
    Replies:
    1
    Views:
    1,034
    Steve Holden
    Nov 16, 2005
  5. hisan
    Replies:
    1
    Views:
    1,316
    Dan Stromberg
    Jun 25, 2012
Loading...

Share This Page