You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by baba smith <ju...@gmail.com> on 2012/01/26 13:14:12 UTC

Tomcat mod_proxy_ajp and workers

hi,
i'm pretty much confused about the workers issue.  
my setup is an apache server and a tomcat that are connected with a
mode_proxy_ajp connector.
the porblem is that some time after that both are working, the tomcat stops
responding to apache. the errors that i see in the apache are:
1. (70007)The timeout specified has expired: ajp_ilink_receive() can't
receive header
2. ajp_read_header: ajp_ilink_receive failed
3. (120006)APR does not understand this error code: proxy: read response
failed from 127.0.0.1:9005 (localhost)

i tries to figure that out reading many posts and i got the idea that maybe
the apache is configured with more workers than the tomcat and that it
causes the apache to time out.

so i looked for the workers configuration and actually i couldnt find any
workers properties file in neither of the servers. (apache 2.2.15 and tomcat
7, were installed by someone else a couple of months ago). 
is there a default configuration that takes place when there is no
properties file for the workers?

the closest thing that i found is in the httpd.conf file of the apache and
it says:
<IfModule worker.c>
   StartServers         4
   MaxClients         300
   MinSpareThreads     25
   MaxSpareThreads     75 
   ThreadsPerChild     25
   MaxRequestsPerChild  0
</IfModule>

whats that?

thank you for your time :)
baba

--
View this message in context: http://tomcat.10.n6.nabble.com/Tomcat-mod-proxy-ajp-and-workers-tp4340550p4340550.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

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


Re: Tomcat mod_proxy_ajp and workers

Posted by Igor Cicimov <ic...@gmail.com>.
Thats the MPM worker settings for apache threads. You need to find the ajp
Proxy part in your config.
On Jan 26, 2012 11:14 PM, "baba smith" <ju...@gmail.com> wrote:

> hi,
> i'm pretty much confused about the workers issue.
> my setup is an apache server and a tomcat that are connected with a
> mode_proxy_ajp connector.
> the porblem is that some time after that both are working, the tomcat stops
> responding to apache. the errors that i see in the apache are:
> 1. (70007)The timeout specified has expired: ajp_ilink_receive() can't
> receive header
> 2. ajp_read_header: ajp_ilink_receive failed
> 3. (120006)APR does not understand this error code: proxy: read response
> failed from 127.0.0.1:9005 (localhost)
>
> i tries to figure that out reading many posts and i got the idea that maybe
> the apache is configured with more workers than the tomcat and that it
> causes the apache to time out.
>
> so i looked for the workers configuration and actually i couldnt find any
> workers properties file in neither of the servers. (apache 2.2.15 and
> tomcat
> 7, were installed by someone else a couple of months ago).
> is there a default configuration that takes place when there is no
> properties file for the workers?
>
> the closest thing that i found is in the httpd.conf file of the apache and
> it says:
> <IfModule worker.c>
>   StartServers         4
>   MaxClients         300
>   MinSpareThreads     25
>   MaxSpareThreads     75
>   ThreadsPerChild     25
>   MaxRequestsPerChild  0
> </IfModule>
>
> whats that?
>
> thank you for your time :)
> baba
>
> --
> View this message in context:
> http://tomcat.10.n6.nabble.com/Tomcat-mod-proxy-ajp-and-workers-tp4340550p4340550.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat mod_proxy_ajp and workers

Posted by baba smith <ju...@gmail.com>.
hi, 
first, thank!

now:
1. in the apache side i've a file named mod_proxy_ajp.cof that is included
from httpd.conf and it says:
<Proxy *>
     AddDefaultCharset Off
     Order deny,allow
     Allow from all
</Proxy>
<Location /tracking>
   ProxyPass ajp://localhost:9005/tracking/
   ProxyPassReverse ajp://localhost:9005/tracking/
   Order deny,allow
   Allow from all
</Location>   
 
2. also in the httpd.conf file there's something that i dont know if its
relevant and it is:
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15

3. in the tomcat side i've in the server.xml:
<Connector port="9005" protocol="AJP/1.3" redirectPort="8443" />

4. in the web.xml:
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>


thanks again


--
View this message in context: http://tomcat.10.n6.nabble.com/Tomcat-mod-proxy-ajp-and-workers-tp4340550p4340646.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

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


Re: Tomcat mod_proxy_ajp and workers

Posted by André Warnier <aw...@ice-sa.com>.
baba smith wrote:
> hi,
> i'm pretty much confused about the workers issue.  
> my setup is an apache server and a tomcat that are connected with a
> mode_proxy_ajp connector.
> the porblem is that some time after that both are working, the tomcat stops
> responding to apache. the errors that i see in the apache are:
> 1. (70007)The timeout specified has expired: ajp_ilink_receive() can't
> receive header
> 2. ajp_read_header: ajp_ilink_receive failed
> 3. (120006)APR does not understand this error code: proxy: read response
> failed from 127.0.0.1:9005 (localhost)
> 
> i tries to figure that out reading many posts and i got the idea that maybe
> the apache is configured with more workers than the tomcat and that it
> causes the apache to time out.
> 
> so i looked for the workers configuration and actually i couldnt find any
> workers properties file in neither of the servers. (apache 2.2.15 and tomcat
> 7, were installed by someone else a couple of months ago). 
> is there a default configuration that takes place when there is no
> properties file for the workers?
> 
> the closest thing that i found is in the httpd.conf file of the apache and
> it says:
> <IfModule worker.c>
>    StartServers         4
>    MaxClients         300
>    MinSpareThreads     25
>    MaxSpareThreads     75 
>    ThreadsPerChild     25
>    MaxRequestsPerChild  0
> </IfModule>
> 
> whats that?
> 

Hi.
It does indeed look like you are a bit confused.  But it is nothing to be ashamed about, 
as the situation is a bit confusing to start with.

One thing at a time..

First, the "<IfModule worker.c>" section above, has nothing to do with the 
Apache-httpd/Apache-Tomcat connection (or at least not directly).  It is just by an 
unfortunate coincidence that the word "worker" is used for different things in more than 
one context.

Second, as far as I know, the term (and file) "workers.properties" is something used 
within the context of the "mod_jk" Apache-httpd/Apache-Tomcat connector.
But you seem to be using "mod_proxy" and "mod_proxy_ajp" as an Apache-httpd/Apache-Tomcat 
connector, so workers.properties should not be relevant for you.

But just to verify this, in your Apache-httpd configuration file(s), do you see any 
directives like :

ProxyPass /someURL AJP://somehost:someport/someURL

and if yes, can you copy them here ?



Additional info :
There are 3 ways to connect Apache-httpd to Apache-Tomcat, in 2 sub-groups :

Subgroup 1 : via HTTP

schema :
browser <-- HTTP --> httpd + mod_proxy_http <-- HTTP --> Tomcat + HTTP <Connector>

Subgroup 2 : via AJP

schema :

a) browser <-- HTTP --> httpd + mod_proxy_ajp <-- AJP --> Tomcat + AJP <Connector>

The documentation for the mod_proxy_ajp module is here : 
http://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html
(but also see the documentation for mod_proxy)

b) browser <-- HTTP --> httpd + mod_jk <-- AJP --> Tomcat + AJP <Connector>

The documentation for mod_jk is mostly here :
http://tomcat.apache.org/connectors-doc/
"worker(s)" is a term used in the mod_jk documentation to talk about "a back-end Tomcat".
That term is not used in the mod_proxy_ajp documentation.



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