title: Bad Gateway 502 error with Apache mod_proxy and Tomcat
body: <p>We're running a web app on Tomcat 6 and Apache mod_proxy 2.2.3.  Seeing a lot of 502 errors like this:</p>
  
  <blockquote>
    <p>Bad Gateway!
    The proxy server received an invalid response from an upstream server.</p>
    
    <p>The proxy server could not handle the request GET /the/page.do.</p>
    
    <p>Reason: Error reading from remote server</p>
    
    <p>If you think this is a server error, please contact the webmaster.</p>
    
    <p>Error 502 </p>
  </blockquote>
  
  <p>Tomcat has plenty of threads, so it's not thread-constrained. We're pushing 2400 users via JMeter against the app.  All the boxes are sitting inside our firewall on a fast unloaded network, so there shouldn't be any network problems.  </p>
  
  <p>Anyone have any suggestions for things to look at or try?  We're heading to tcpdump next.</p>
  
  <p>UPDATE 10/21/08: Still haven't figured this out. Seeing only a very small number of these under load.  The answers below haven't provided any magical answers...yet. :)</p>