HTTP keep-alive performance



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
.



Relevant Pages

  • Re: Cant send back null class reference as SOAP Header?
    ... State is maintained on the server (no ... the client actually maintains the key to the state ... If they then retry the request, the flag won't be sent, will it? ... The header is defined as Direction.InOut on every ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: GroupWise 7.0.1-Client: Disposition-Notification-To?
    ... Teilen auch Server, vor allem beim Senden, denn da legt der *Client* ... selber ganz alleine die Header fest, und versendet selber per SMTP. ...
    (de.comp.sys.novell)
  • Re: UDP server scalability question
    ... why are you setting up an ACK on UDP? ... If this is all the server does, spawning multiple threads will most likely ... Unless the ACK is giving data (what the client should ...
    (microsoft.public.dotnet.framework)
  • Re: tcpdump question
    ... F is for FIN ... client> server SYN ... sever> client SYN ACK ...
    (freebsd-questions)
  • Re: File Data and Time
    ... WebClient class does give some size in the Progress event i found it ... An HTTP server isn't required to provide that information, ... The closest thing is the value of the Last-Modified header, ... you need a better client interface. ...
    (microsoft.public.dotnet.framework)