Thursday, December 4, 2008

502 Error: Bad Proxy

In the process of performance testing the examinator reference application of Terracotta, we faced a lots of 502 errors. During the performance testing few of the virtual users were receiving 502 error from the load balancer.

Load balancer: Apache HTTP server, mod_proxy_balancer module
App Server: Tomcat 6

The error received were

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<html><head>

<title>502 Proxy Error</title>

</head><body>

<h1>Proxy Error</h1>

<p>The proxy server received an invalid response from an upstream server.<br />

The proxy server could not handle the request <em><a href="/examinator/exam/list.do">GET&nbsp;/examinator/exam/list.do</a></em>.<p>

Reason: <strong>Error reading from remote server</strong></p></p>

<hr>

<address>Apache/2.2.3 (Linux/SUSE) Server at xyz.abc.lan Port 80</address>

</body></html>

By disabling keepAlive on tomcat server, we were able to reduce these errors. http://tomcat.apache.org/tomcat-6.0-doc/config/http.html

<Connector port="8080" protocol="HTTP/1.1"
maxKeepAliveRequests="1"
redirectPort="8443" />
Post a Comment