Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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 5:30
up vote 0 down vote accepted

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?)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.