You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Lloyd <ja...@gmail.com> on 2013/03/26 21:44:15 UTC

Tomcat 7.0.33 - 502 to HTTP Gateway (Traffic Server) on Long Running Requests

-------------------------------------------
ISSUE DETAILS:
-------------------------------------------

My Tomcat 7 web app is fronted by a HTTP gateway (apache traffic server)
that provides caching\OAuth authentication etc.

My REST\JSON API web app hosted in Tomcat 7 is retrieving database data and
serializing into JSON in the HTTP response.

Most of the API calls customers make will retrieve a few hundred or a few
thousand rows which takes the server-side sub-second time and a couple of
seconds of network time.

------------
PROBLEM:
------------

There a few customers that need to make API calls that will retrieve a
couple of million rows serialized into JSON.

These operations on the Tomcat 7 web app server-side, as expected, takes
30-32 seconds.

The issue is that the HTTP gateway (apache traffic server) is configured
with a global 30 second timeout which results in a timeout to the caller.

Since I can't change this on the HTTP gateway, is there a way to send some
kind of TCP traffic to the HTTP gateway so it knows I'm still working?

In looking at the connection under wireshark, it appears that Tomcat is
sending 502's because it never sent the FIN ACK, just an ACK to the HTTP
gateway.

So Tomcat thinks the connection was open but the HTTP gateway (apache
traffic server) was done with it and just kept re-sending it's attempts to
reconnect.

The stack of the web app hosted on Tomcat is: Apache CXF\Spring

Any thoughts?

-------------------------------------------
Environment Info:
-------------------------------------------

Apache Tomcat:    7.0.33
JVM:              1.6.0_37-b06
JVM Vendor:       Sun Microsystems Inc.
OS Name:          Linux
OS Version:       2.6.32-279.el6.x86_64
OS Architecture:  amd64

Thanks,
Jacob

Re: Tomcat 7.0.33 - 502 to HTTP Gateway (Traffic Server) on Long Running Requests

Posted by Giles <co...@googlemail.com>.
On 26 March 2013 20:44, Jacob Lloyd <ja...@gmail.com> wrote:
> -------------------------------------------
> ISSUE DETAILS:
> -------------------------------------------
>
> My Tomcat 7 web app is fronted by a HTTP gateway (apache traffic server)
> that provides caching\OAuth authentication etc.
>
> My REST\JSON API web app hosted in Tomcat 7 is retrieving database data and
> serializing into JSON in the HTTP response.
>
> Most of the API calls customers make will retrieve a few hundred or a few
> thousand rows which takes the server-side sub-second time and a couple of
> seconds of network time.
>
> ------------
> PROBLEM:
> ------------
>
> There a few customers that need to make API calls that will retrieve a
> couple of million rows serialized into JSON.
>
> These operations on the Tomcat 7 web app server-side, as expected, takes
> 30-32 seconds.
>
> The issue is that the HTTP gateway (apache traffic server) is configured
> with a global 30 second timeout which results in a timeout to the caller.
>
> Since I can't change this on the HTTP gateway, is there a way to send some
> kind of TCP traffic to the HTTP gateway so it knows I'm still working?
>
> In looking at the connection under wireshark, it appears that Tomcat is
> sending 502's because it never sent the FIN ACK, just an ACK to the HTTP
> gateway.
>
> So Tomcat thinks the connection was open but the HTTP gateway (apache
> traffic server) was done with it and just kept re-sending it's attempts to
> reconnect.
>
> The stack of the web app hosted on Tomcat is: Apache CXF\Spring
>
> Any thoughts?
>
> -------------------------------------------
> Environment Info:
> -------------------------------------------
>
> Apache Tomcat:    7.0.33
> JVM:              1.6.0_37-b06
> JVM Vendor:       Sun Microsystems Inc.
> OS Name:          Linux
> OS Version:       2.6.32-279.el6.x86_64
> OS Architecture:  amd64
>
> Thanks,
> Jacob

If you cannot control the timeout on the gateway server, nor reject
requests that are not going to process in time, you might need to
re-design your application to partition your response and reply back
with a 206.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org