You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Farid Izem <fa...@gmail.com> on 2010/02/05 23:11:58 UTC
Apache / mod_proxy / Tomcat
Hi,
I have setup an Apache Web Server in front of a Tomcat Web Container.
Basically, All request are handle by Apache and passed to Tomcat using
mod_proxy_ajp
Apache is binded on the IP address of the computer, tomcat is binded
on localhost:8009
When i take a look at the tomcat manager, i see that a lot of Tomcat
Thread with the status keepalive from the same source IP address.
The main configuration of :
ProxyPass /webapp ajp://localhost:8009/webapps retry=30
ProxyPassReverse /webapp ajp://localhost:8009/webapps
Would it be possible to free the connection from Apache Server to
Tomcat server ?
Netstat show a lot of established connections but there is not data sent.
How could we free these keepalive connections that are being
maintained between Apache and Tomcat.
i tryied
ProxyPass /webapp ajp://localhost:8009/webapps
retry=30 disablereuse=On
but this is not recognize.
Can anyone help me ?
Regards,
Farid.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Apache / mod_proxy / Tomcat
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Farid Izem [mailto:farid.izem@gmail.com]
> Subject: Apache / mod_proxy / Tomcat
>
> I have setup an Apache Web Server in front of a Tomcat Web Container.
> Basically, All request are handle by Apache and passed to Tomcat using
> mod_proxy_ajp
If you're passing all requests through to Tomcat, why are you bothering with httpd in front? Just trying to make things slower?
> When i take a look at the tomcat manager, i see that a lot of Tomcat
> Thread with the status keepalive from the same source IP address.
Which is as it should be.
> Would it be possible to free the connection from Apache Server to
> Tomcat server ?
Why would you want to do that? When a request does arrive at httpd to be forwarded to Tomcat and there are no active connections to Tomcat, one will have to be negotiated, which takes time. The idle, maintained connections are part of the basic AJP design philosophy.
> Can anyone help me ?
I don't think you have a problem.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Apache / mod_proxy / Tomcat
Posted by Bill Barker <bi...@verizon.net>.
"André Warnier" <aw...@ice-sa.com> wrote in message
news:4B6CA79C.3090803@ice-sa.com...
> Farid Izem wrote:
>> Hi,
>>
>> I have setup an Apache Web Server in front of a Tomcat Web Container.
>> Basically, All request are handle by Apache and passed to Tomcat using
>> mod_proxy_ajp
>> Apache is binded on the IP address of the computer, tomcat is binded
>> on localhost:8009
>> When i take a look at the tomcat manager, i see that a lot of Tomcat
>> Thread with the status keepalive from the same source IP address.
>>
>> The main configuration of :
>> ProxyPass /webapp ajp://localhost:8009/webapps retry=30
>> ProxyPassReverse /webapp ajp://localhost:8009/webapps
>>
>> Would it be possible to free the connection from Apache Server to
>> Tomcat server ?
>> Netstat show a lot of established connections but there is not data sent.
>> How could we free these keepalive connections that are being
>> maintained between Apache and Tomcat.
>>
>> i tryied
>> ProxyPass /webapp ajp://localhost:8009/webapps
>> retry=30 disablereuse=On
>> but this is not recognize.
>>
> I don't know about the above settings.
> Apart from what Chuck mentioned, what is the setting, in the Apache httpd
> configuration, of the KeepAliveTimeout ?
>
> If you set that to 30 seconds, then it means that after the browser sent
> the last request that it is ever going to send, Apache will maintain the
> connection with the browser for 30 seconds, waiting for another request
> that will never come.
> That probably means that it will also maintain the connection with Tomcat,
> and thus that Tomcat will keep the corresponding thread waiting for the
> same time, all for nothing.
> Set KeepAliveTimeout to 3 for example, and see what happens.
That will help Apache, but will have a relatively small effect on number of
AJP/1.3 connections. That is because the AJP/1.3 connections are shared
across different browser connections by design (and why not clearing data in
a ThreadLocal can end up sharing data between users). And with the default
settings, AJP/1.3 connections last forever.
If someone actually cares about the number of connections (which some old
Linux kernels do), then set a connectionTimeout to a reasonable value (say
5min) in the Tomcat <Connector /> tag in server.xml. That will cause
Tomcat to close the connection when it times out, and Apache can establish a
new connection when necessary. With mod_jk, this works best if you also
configure it to use cping/cpong.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Apache / mod_proxy / Tomcat
Posted by André Warnier <aw...@ice-sa.com>.
Farid Izem wrote:
> Hi,
>
> I have setup an Apache Web Server in front of a Tomcat Web Container.
> Basically, All request are handle by Apache and passed to Tomcat using
> mod_proxy_ajp
> Apache is binded on the IP address of the computer, tomcat is binded
> on localhost:8009
> When i take a look at the tomcat manager, i see that a lot of Tomcat
> Thread with the status keepalive from the same source IP address.
>
> The main configuration of :
> ProxyPass /webapp ajp://localhost:8009/webapps retry=30
> ProxyPassReverse /webapp ajp://localhost:8009/webapps
>
> Would it be possible to free the connection from Apache Server to
> Tomcat server ?
> Netstat show a lot of established connections but there is not data sent.
> How could we free these keepalive connections that are being
> maintained between Apache and Tomcat.
>
> i tryied
> ProxyPass /webapp ajp://localhost:8009/webapps
> retry=30 disablereuse=On
> but this is not recognize.
>
I don't know about the above settings.
Apart from what Chuck mentioned, what is the setting, in the Apache
httpd configuration, of the KeepAliveTimeout ?
If you set that to 30 seconds, then it means that after the browser sent
the last request that it is ever going to send, Apache will maintain the
connection with the browser for 30 seconds, waiting for another request
that will never come.
That probably means that it will also maintain the connection with
Tomcat, and thus that Tomcat will keep the corresponding thread waiting
for the same time, all for nothing.
Set KeepAliveTimeout to 3 for example, and see what happens.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org