0

I am running a Tomcat server (6.0.28) on a Ubuntu (10.10) with APR enabled (direct on port 80 without any Web server fronting).

When I submit a page from the browser and the POST data is big (> 1444 bytes), the request fails and I get a "504" error. If the data is less, the request succeeds.

This is a problem only when the site is accessed behind a Squid proxy server and/or low bandwidth. There is no issue if the site is accessed from a fast Internet connection.

I have enabled the RequestDumperValve and it consistently shows a truncated POST request and then aborts without logging anything in the tomcat access log.

To confuse things, I have this:

  • the same app on another server behind an AWS Elastic Load Balancer (Amazon EC2, Tomcat 6.0.28/Ubuntu 10.10) that works
  • the same app on another server behind an Apache2 server (Amazon EC2, mod_jk, Tomcat 6.0.24/Ubuntu 10.04) that works
  • the same app on another server behind an Apache2 server (Amazon EC2, mod_jk, Tomcat 6.0.24/Ubuntu 10.04) that DOES NOT works

I have compared the apache2 configuration files and tomcat configuration files and don't find any difference.

My observations so far:

  • If I reduce the POST body content length to less than 1444, the POST request succeeds and the response is very fast (sub-second).
  • Anything more and the request returns with a 504 error.
  • On servers that the POST works, content with even length 1910 is not a problem. However, the response is much delayed (~20 seconds for first byte from server) when compared to smaller POST requests where it is sub-second).
  • The POST is aborted by Tomcat at always the same place - just before arguments start
  • A few other users have also reported this issue where the bandwidth is low and there is a firewall appliance involved with perhaps content filtering on.

On Tomcat configuration side, APR is enabled and disableUploadTimeout="false". Everthing else is default.

Or is this a Squid issue after all? Or something at the network / TCP level?

Any hints on what else I can try?

sayeed
  • 384
  • 2
  • 8
  • Just out of curiosity, have you tried increasing Tomcat's maxHttpHeaderSize to see if that does any thing? – mahnsc Apr 20 '11 at 12:30
  • Thanks, tried that too but to no avail. Looks like ISP / EC2 network issue rather than the servers. Working with Amazon support to look into this. – sayeed Apr 21 '11 at 05:30

1 Answers1

0

This was an issue related to MTU size. When the clients were using ADSL modems and the routers had PMTU blackhole problem, this strange issue would crop up.

We lowered the MTU on our servers to 4192 and everything was fine. (Is this a best practice or what?)

sayeed
  • 384
  • 2
  • 8