Bug 42871 - Performance with proxy connections (missing TCP_NODELAY)
Summary: Performance with proxy connections (missing TCP_NODELAY)
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 2.2.4
Hardware: Other AIX
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2007-07-12 07:38 UTC by Christian BOITEL
Modified: 2007-09-03 13:57 UTC (History)
0 users



Attachments
Patch for modules/proxy/proxy_util.c (986 bytes, patch)
2007-07-12 07:39 UTC, Christian BOITEL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian BOITEL 2007-07-12 07:38:24 UTC
While running performance testes, we have run into an issue when an Apache web 
server is set in front of a tomcat (ajp in between).

When POST http requests were forwarded, we were experiencing the following 
network sequence:
- a first ajp packet containing headers/request was forwarded by Web server to 
tomcat: body data aren't included in it
- Web server would wait for tomcat server to send back an TCP/IP ACK
- Web server would then send the second ajp packet containing the POST body 
data
=> TCP/IP ACK can take as much as 150ms to be sent (Naggle algorithm)
=> if tomcat app needs to process post data, it will block this amount of time 
before being able to process it

In proxy_util.c, sockets being created do not have the TCP_NODELAY option set: 
i have patched the module and performed testes again. Now, web server no 
longer waits for the tomcat ack to be sent and post data are sent immediately 
after the first packet. Response time have then been lowered.

I will attach the patch to proxy_util.c: it applies to non ftp proxy 
connections. For ftp, i have found that mod_proxy_ftp.c opens its own sockets 
and would require a similar patch not provided here.
Comment 1 Christian BOITEL 2007-07-12 07:39:33 UTC
Created attachment 20497 [details]
Patch for modules/proxy/proxy_util.c

Hope this will help and don't forget to patch mod_proxy_ftp.c also
Comment 2 Jim Jagielski 2007-08-03 08:57:21 UTC
In trunk. potential backport for 2.2.x
Comment 3 Ruediger Pluem 2007-09-02 02:59:44 UTC
Proposed for backport as r571936 (http://svn.apache.org/viewvc?rev=571936&view=rev).
Comment 4 Ruediger Pluem 2007-09-03 13:57:06 UTC
Backported to 2.2.x as r572419 (http://svn.apache.org/viewvc?rev=572419&view=rev).