You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Plana, Richard" <Ri...@mtsallstream.com> on 2008/06/27 23:38:39 UTC

Problem with mod_proxy_ajp Connection Timeout

Hi,
 
Our Apache httpd proxy connects to the two tomcat servers
(load-balanced) through a network device that performs NAT.
Unfortunately, when the connections go idle (and it happens quite often
since it's a currently low-volume application), the NAT box seems to
lose the TCP session. The Apache httpd remains connected (ESTABLISHED
using netstat), but the connection on the Tomcat servers aren't
reflected on that end. Performing an "apachectl graceful" gets the
server to re-establish the connection.
 
I'm wondering what my options are to fixing this? I tried adding a
ProxyTimeout 60 option, but that didn't seem to work. Is there a way to
tell mod_proxy_ajp that if it's idle for a given amount of time to close
the connection? (And establish a new one when a request comes in)
--
 
Richi Plana

Re: Problem with mod_proxy_ajp Connection Timeout

Posted by Rainer Jung <ra...@kippdata.de>.
Plana, Richard schrieb:
> I've upgraded to httpd-2.2.9 and added ping=120 to my BalancerMember
> line and the connection still times out and becomes hung. The only thing
> I'm getting on the logs is the following:
> 
> 	[Thu Jul 03 14:02:12 2008] [error] (70007)The timeout specified
> has expired: ajp_ilink_receive() can't receive header
> 
> In fact, this is my ProxyPass (BalancerMember) line:
> 
> 	BalancerMember ajp://application:8009/myapp max=10 smax=6 ttl=30
> ping=120 route=jvm1
> 
> Is there a way to verify that it is indeed sending traffic across the
> lines?

Don't you also get one of the following two log lines:

- "ajp_read_header: ajp_ilink_receive failed"
- "ajp_handle_cping_cpong: ajp_ilink_receive failed"

The first one would indicate, that httpd gave up waiting for the 
response, so the processing time on the backend is to big. The second 
one indicates, that the cping/cpong didn't work and the backend couldn't 
even send the cpong.

You can also add %D to your LogFormat, which would include the 
microsecond response time to your access log (so you can see, how big 
the timeout was, that fired). It's microseconds, because milliseconds 
are not implemented and seconds is to rough.

If you increase your LogLevel to debug, then you'll get additional 
messages, like begin and end of the cping/cpong cycle.

Regards,

Rainer

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


RE: Problem with mod_proxy_ajp Connection Timeout

Posted by "Plana, Richard" <Ri...@mtsallstream.com>.
I've upgraded to httpd-2.2.9 and added ping=120 to my BalancerMember
line and the connection still times out and becomes hung. The only thing
I'm getting on the logs is the following:

	[Thu Jul 03 14:02:12 2008] [error] (70007)The timeout specified
has expired: ajp_ilink_receive() can't receive header

In fact, this is my ProxyPass (BalancerMember) line:

	BalancerMember ajp://application:8009/myapp max=10 smax=6 ttl=30
ping=120 route=jvm1

Is there a way to verify that it is indeed sending traffic across the
lines?
--

Richi


-----Original Message-----
From: Rainer Jung [mailto:rainer.jung@kippdata.de] 
Sent: Friday, June 27, 2008 5:05 PM
To: Tomcat Users List
Subject: Re: Problem with mod_proxy_ajp Connection Timeout

Plana, Richard schrieb:
> Hi,
>  
> Our Apache httpd proxy connects to the two tomcat servers
> (load-balanced) through a network device that performs NAT.
> Unfortunately, when the connections go idle (and it happens quite 
> often since it's a currently low-volume application), the NAT box 
> seems to lose the TCP session. The Apache httpd remains connected 
> (ESTABLISHED using netstat), but the connection on the Tomcat servers 
> aren't reflected on that end. Performing an "apachectl graceful" gets 
> the server to re-establish the connection.
>  
> I'm wondering what my options are to fixing this? I tried adding a 
> ProxyTimeout 60 option, but that didn't seem to work. Is there a way 
> to tell mod_proxy_ajp that if it's idle for a given amount of time to 
> close the connection? (And establish a new one when a request comes 
> in)

Look at

    http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

especially search for "ttl" and "smax" for closing idle connections. In
addition "ping" helps in detecting broken connections. In order to use
ping, you should use httpd 2.2.9, because there have some recent fixes
with AJP ping in mod_proxy_ajp.

Regards,

Rainer

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


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


Re: Problem with mod_proxy_ajp Connection Timeout

Posted by Rainer Jung <ra...@kippdata.de>.
Plana, Richard schrieb:
> Hi,
>  
> Our Apache httpd proxy connects to the two tomcat servers
> (load-balanced) through a network device that performs NAT.
> Unfortunately, when the connections go idle (and it happens quite often
> since it's a currently low-volume application), the NAT box seems to
> lose the TCP session. The Apache httpd remains connected (ESTABLISHED
> using netstat), but the connection on the Tomcat servers aren't
> reflected on that end. Performing an "apachectl graceful" gets the
> server to re-establish the connection.
>  
> I'm wondering what my options are to fixing this? I tried adding a
> ProxyTimeout 60 option, but that didn't seem to work. Is there a way to
> tell mod_proxy_ajp that if it's idle for a given amount of time to close
> the connection? (And establish a new one when a request comes in)

Look at

    http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

especially search for "ttl" and "smax" for closing idle connections. In 
addition "ping" helps in detecting broken connections. In order to use 
ping, you should use httpd 2.2.9, because there have some recent fixes 
with AJP ping in mod_proxy_ajp.

Regards,

Rainer

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