Author |
|
slaklu
Joined: 06 Oct 2014 Posts: 8
|
Posted: Thu 20 Nov '14 16:36 Post subject: apache 2.4 mod_proxy lots of TIME_WAIT TCP connections |
|
|
Consider following setup:
- httpd-2.4.10-win64-VC11.zip + apache-tomcat-7.0.57-windows-x64
- windows server 2008/2012/7
- tomcat: ajp connector enabled
- apache: mod_proxy + mod_proxy_ajp enabled
- apache: simple proxy pass + proxy pass reverse directive
After each request to apache, new TCP connection to tomcat is created, ie. when refreshing page using browser, 10 new connections are created. They have TIME_WAIT status and are destroyed after 240 seconds (windows default TCP connection limit: TcpTimedWaitDelay). After lots of request in the short time, the system connection pool can be exceeded which causes apache error: OS 10055. If we decrease TcpTimedWaitDelay to 30 seconds, it's match better but the still may occur.
Another setup:
- almost same conditions, only older apache: httpd-2.2.25-win32-x86-no_ssl.msi
Apache creates one TCP connection per each proxypass directive and reuse this connection.
Do you know why it works in that way? And how to force apache 2.4 to work in the same way - or at least how to configure the connection pool to tomcat. I have tried with disablereuse, keepalaive, max, paremeters but without success. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 20 Nov '14 18:18 Post subject: |
|
|
With 2.4 do you use any additonal parameters or just
Code: |
<Location />
ProxyPass ajp://localhost:8009/
ProxyPassReverse ajp://localhost:8009/
</Location>
|
|
|
Back to top |
|
slaklu
Joined: 06 Oct 2014 Posts: 8
|
|
Back to top |
|
slaklu
Joined: 06 Oct 2014 Posts: 8
|
Posted: Fri 21 Nov '14 14:32 Post subject: |
|
|
I have noticed that issue occur only on windows. Linux version reuse ESTABLISHED connection. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 21 Nov '14 18:23 Post subject: |
|
|
I have looked a bit deeper into this and it seems to be a bug in mod proxy ajp.
However you should try adjusting the KeepAlive interval (KeepAliveTimeout) on httpd and tomcat.
And or disable KeepAlive for testing on the apache side. |
|
Back to top |
|
admin Site Admin
Joined: 15 Oct 2005 Posts: 692
|
|
Back to top |
|
slaklu
Joined: 06 Oct 2014 Posts: 8
|
Posted: Wed 26 Nov '14 11:45 Post subject: |
|
|
Yes, even by me. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 08 Dec '14 18:29 Post subject: |
|
|
Did you play with the keep Alive settings? |
|
Back to top |
|
slaklu
Joined: 06 Oct 2014 Posts: 8
|
Posted: Tue 09 Dec '14 9:06 Post subject: |
|
|
Yes, without success. |
|
Back to top |
|
slaklu
Joined: 06 Oct 2014 Posts: 8
|
|
Back to top |
|
admin Site Admin
Joined: 15 Oct 2005 Posts: 692
|
Posted: Tue 09 Dec '14 15:21 Post subject: |
|
|
Did you try the workaround mentioned there, not using port. |
|
Back to top |
|
slaklu
Joined: 06 Oct 2014 Posts: 8
|
Posted: Tue 09 Dec '14 15:50 Post subject: |
|
|
Yes, it works. You can skip the port and use default one.
I have also tried to used not-standard port, it works as well. |
|
Back to top |
|