Forum Discussion
astokes_6920
Nimbostratus
Nov 10, 2009HTTP monitor with HEAD, not GET
While using the following monitor, I'm finding that the web servers are keeping TCP sessions in the TIME_WAIT state, rather than closing them outright.
GET /serverin.html HTTP/1.1\r\nConnection: Close\r\nHost: \r\n\r\n
My understanding was that by specifying HTTP 1.1, with the Close and carriage return, I'd be forcing the FIN and FINACK thereby closing the connection. Unfortunately, at any given time, I've got 3000 plus TIME_WAIT states on my web server courtesy of the F5. Obviously I'm missing something here.
Is it possible to use HEAD instead of GET within the send string to correct this? Or is there something else I need to add to the existing string to force an outright closing of the connection?
I've checked the archives here and am not finding a whole lot on the use of HEAD within a monitor.
Any assistance is greatly appreciated.
- hoolio
Cirrostratus
I thought the Connection header is a suggestion to the destination host that the sender doesn't intend to reuse the TCP connection. I think it might be up to the recipient to close the TCP connection. RFC2616 doesn't seem to state this clearly, but I've read it other places: - astokes_6920
Nimbostratus
Thanks for that advice. I applied your suggestion of removing the two explicit CRLF earlier today, but checking back in three hours later, a "netstat -n" on the IIS server still shows over 3000 connections in TIME_WAIT. - astokes_6920
Nimbostratus
I did get output from an ethereal packet capture. - L4L7_53191
Nimbostratus
This really isn't a monitor issue, and I always recommend that you add a connection: close, which will notify your web server to close this socket down and be prepared to accept another client request as opposed to maintaining a keep-alive connection (and occupying a socket that could happily service requests) to the LTM even though it won't be re-used. - Justinian_48178
Nimbostratus
We're having this exact same issue. We did tune our TIME_WAIT timers (and as a good measure increased our max ports), but I'd still love to find a way around this if anyone has one. - L4L7_53191
Nimbostratus
FWIW I consider this to be a best practice: tuning your server stack for a specific workload. - Daniel_23711
Nimbostratus
Has anyone gotten any further on this issue? I was running version 9.3 and then recently upgraded to version 10.1 and immediately my HTTP monitors were causing issues on our web servers. I was seeing a lot of connections in TIME_WAIT, and I was noticing that the httpd processes virtual memory continued to steadily increase until the host would eventually run out of swap space. My current setup is Apache front-end, tomcat on the back end using AJP connectors. I have a JSP script that does some health checks and then responds back with a simple 'STATUS=OK'. I since have changed the JSP script and removed all my JSP code, and have just 'STATUS=OK' in the mystatus.jsp and still I am having the same issue where HTTP sessions never expire, however this only happens on requests generated from F5 HTTP monitors. I can use 'curl' all day long from my desktop and never see the httpd processes memory fill up. I did do a tcpdump and I am seeing the FIN responses from the F5 and all tcpdump traffic viewed by wireshark to me looks as expected, including when compared to the same requests/captures I am doing from my desktop directly to the web server. I am at a lost here. I have changed my HTTP monitor to a TCP monitor and provided the same GET request "GET /mystatus.jsp HTTP/1.1\r\n\r\n" and I continue to have the same issue; so issue is not just in the HTTP monitor template. Definitely something changed from version 9.3 to version 10.1 that is causing this. I disabled the HTTP monitors, and the web servers httpd processes behave as expected, and I have a lot more traffic flowing through the F5 to my web servers than what the monitors are producing. - hoolio
Cirrostratus
Hi Daniel, - L4L7_53191
Nimbostratus
I second Aaron's comment about adding Connection: close - give this a try first. That should explicitly tell the server to close down the connection and not assume a keep-alive request. - Dazzla_20011
Nimbostratus
Hi,
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects