2

I get an intermittent timeout processing some AJAX POST request. Setup: Apache 2.2.17 -> mod_jk 1.2.26 -> JBoss 4.3 CP01 (with Tomcat 6.0). Application is built with JSF 1.2_11, Seam 2.1, RichFaces 3.3.1.

It usually happens with IE browsers (7,8,9). The browser sends an ajax request (RichFaces produces JavaScript code for that). This HTTP POST request gets transformed into AJP Header and body packets by mod_jk and sent to Tomcat. The header package says content length is 1760, but the body packet has 0 in the length field and no content. The packets were captured with tcpdump. The 0 ajp body packet doesn't happen for every problematic request. All ajax requests/responses are small, up to 30K, no file uploads and no lengthy DB queries.

At this stage, mod_jk log shows the request was processed in 2 minutes. In our test environment we also got 2,3,4, and 6 minutes. The application filter that wraps the request also shows 2 minutes time; the filter is simple - get timestamp before and after the request and log the difference.

JSF phase listener of the app is invoked, with each phase (request, view restore, validation, invoke, render) taking on the order of 100ms - usual for the app. So the timeout must happen between at the start of the request (after filter and before 1st JSF phase) or at the end (after render JSF phase and before filter end).

Sometime, mod_jk says read timeout by client; who is the client - browser, apache? There are no exceptions logged in JBoss, at DEBUG level.

Did somebody come across something similar? mod_jk reply_timeout setting doesn't solve the issue. Connecting straight to JBoss gives us around 30s timeout, which we never saw before and we don't know if it's related to the 2min timeout.

JavaMonkey123
  • 51
  • 1
  • 4

2 Answers2

0

We hit this issue in IE: http://support.microsoft.com/kb/821814. Our KeepAliveTimeout was set to 3s, and the response from the server sometimes came on that boundary, causing Apache to drop the connection after the response header was already sent.

Solution for us was dual infrastructure: external clients don't get KeepAlive, since they don't need to SSO login. Intranet clients now go to a different Apache server (since KeepAlive is server-wide, not vhost-specific).

JavaMonkey123
  • 51
  • 1
  • 4
0

We have had a the same/similar issue. We have noticed it to be exactly 5 minutes. We were using Tomcat 6/Apache AJP/Richfaces 3.3.3 Final.

I was able to modify the httpd.conf on apache to get some satisfaction.

Timeout was changed to 4 minutes from 5, this caused the "timeouts" to move to 4 minute timeouts rather than 5. So I suspected I was on the right track.

Next I modified the httpd.conf MaxKeepAliveRequests from the default of 100 to 200 and it substantially reduced the number of "4 minute pause" incidents.

Edit:

KeepAliveTimeout was increased to 40 seconds from 10 seconds MaxKeepAliveRequests was set to 0 (unlimited)

This seems to have eliminated our issue. Obviously these settings need be set based on the type/amount of traffic to your server, but this is working for us.