You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Xuekun Hu <xu...@gmail.com> on 2005/08/31 16:15:00 UTC

"ProxyPass ajp://localhost:8009 max=10" useless?

I have been struggling for two weeks trying to integrate
Apache2.1.6-alpah and TOMCAT 5.5.9. I am very appreciated that someone
could help me here.

Below is the configuration that I used: 

<IfModule mod_proxy.c>
ProxyPass /jspdir ajp://localhost:8009/jspdir
ProxyPassReverse /jspdir ajp://localhost:8009/jspdir
</IfModule>
....

When I tested with lots of connections, soon I found there are some
errors in Apache log and Tomcat log.
In Apache log: 
[Wed Aug 31 16:29:07 2005] [notice] Apache/2.1.7 (Unix) mod_ssl/2.1.7
OpenSSL/0.9.8 configured -- resuming normal operations
[Wed Aug 31 16:32:22 2005] [error] ajp_check_msg_header() got bad signature 426
[Wed Aug 31 16:32:22 2005] [error] ajp_ilink_receive() received bad header
[Wed Aug 31 16:32:22 2005] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Aug 31 16:32:22 2005] [error] (120007)APR does not understand
this error code: proxy: read response failed from (null) (*)
[Wed Aug 31 16:32:22 2005] [error] ajp_check_msg_header() got bad signature d3a
[Wed Aug 31 16:32:22 2005] [error] ajp_ilink_receive() received bad header
[Wed Aug 31 16:32:22 2005] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Aug 31 16:32:22 2005] [error] (120007)APR does not understand
this error code: proxy: read response failed from (null) (*)

In TOMCAT log: 
Aug 31, 2005 11:08:56 AM org.apache.tomcat.util.threads.ThreadPool logFull
SEVERE: All threads (8,000) are currently busy, waiting. Increase
maxThreads (8,000) or check the servlet status

So to limit the number of connections to TOMCAT, I set the "max"
parameter behind ProxyPass
              ProxyPass /jspdir ajp://localhost:8009/jspdir max=10

I run test again, and errors occured again. I used "netstat -an" to
see how many connections to localhost:8009. And I found the number of
connections are greater than 10!!!

So is the "max" parameter useless for proxy_ajp connection? Any
suggestions of configuration?

Thx, Xuekun

Re: "ProxyPass ajp://localhost:8009 max=10" useless?

Posted by Xuekun Hu <xu...@gmail.com>.
Thanks, I have noticed that. For the later testing, I only used the
single directive ProxyPass.

Thx, Xuekun

On 9/5/05, Mladen Turk <mt...@apache.org> wrote:
> Xuekun Hu wrote:
> > Since the errors are still there, if my configuration is right, I
> > think it should be a proxy_ajp bug. I will file a bug report later.
> >
> 
> Hi.
> Please do file a bugzilla entry.
> 
> You have a bug in your config:
> <IfModule mod_proxy.c>
> ProxyPass /jspdir ajp://localhost:8009/jspdir
> ProxyPassReverse /jspdir ajp://localhost:8009/jspdir
> </IfModule>
> 
> Having both ProxyPass and ProxyPassReverse, you are actually
> using a 'generic' proxy worker with connection limited to
> MaxThreads not to 10, as shown in the log:
> [Wed Aug 31 16:32:22 2005] [error] (120007)APR does not understand
> this error code: proxy: read response failed from (null) (*)
> 
> 
> Simlpy use a single directive: ProxyPass.
> 
> Regards,
> Mladen.
> 
> 
>

Re: "ProxyPass ajp://localhost:8009 max=10" useless?

Posted by Mladen Turk <mt...@apache.org>.
Xuekun Hu wrote:
> Since the errors are still there, if my configuration is right, I
> think it should be a proxy_ajp bug. I will file a bug report later.
> 

Hi.
Please do file a bugzilla entry.

You have a bug in your config:
<IfModule mod_proxy.c>
ProxyPass /jspdir ajp://localhost:8009/jspdir
ProxyPassReverse /jspdir ajp://localhost:8009/jspdir
</IfModule>

Having both ProxyPass and ProxyPassReverse, you are actually
using a 'generic' proxy worker with connection limited to
MaxThreads not to 10, as shown in the log:
[Wed Aug 31 16:32:22 2005] [error] (120007)APR does not understand
this error code: proxy: read response failed from (null) (*)


Simlpy use a single directive: ProxyPass.

Regards,
Mladen.



Re: "ProxyPass ajp://localhost:8009 max=10" useless?

Posted by Xuekun Hu <xu...@gmail.com>.
Since the errors are still there, if my configuration is right, I
think it should be a proxy_ajp bug. I will file a bug report later.

Thx, Xuekun

Re: "ProxyPass ajp://localhost:8009 max=10" useless?

Posted by Xuekun Hu <xu...@gmail.com>.
Thanks for your answer. Now I understand what the max means. 
However the errors occured again. I don't know if the error shows a
bug or just my configuration error, so I sent to dev list.

I used worker MPM. 

ThreadLimit     600
<IfModule worker.c>
StartServers         4
MaxClients         24000
ServerLimit     50
MinSpareThreads      1000
MaxSpareThreads      2000
ThreadsPerChild     600
MaxRequestsPerChild  0
ListenBackLog   3000
</IfModule>
MaxRequestsPerChild  0

ProxyPass /jspdir ajp://localhost:8009/jspdir max=10

My TOMCAT configuration: 
    <Connector port="8009" maxHttpHeaderSize="8192"
               maxThreads="8000" minSpareThreads="4000" maxSpareThreads="8000"
               acceptCound="50000" enableLookups="false"
redirectPort="8443" protocol="AJP/1.3"
               tomcatAuthentication = "false" />

So the max connections httpd created should be 50 * 10 = 500, however
TOMCAT threads are 8000. So why these errors happened? (Apache errors
happened first, then TOMCAT errors).

Thx, Xuekun

> Apart from the fact that I think that these questions belong to the users list:
> 
> max ensures that not more then max connections get created *per* Apache child process.
> 
> So the questions are
> 
> 1. What MPM do you use?
> 2. What is your setting for ServerLimit?
> 
> Provided that you use the worker MPM the maximum number of total connections
> httpd creates is max * ServerLimit.
> 
> Regards
> 
> RĂ¼diger
> 
>

Re: "ProxyPass ajp://localhost:8009 max=10" useless?

Posted by r....@t-online.de.

Xuekun Hu wrote:

[..cut..]
> 
> So to limit the number of connections to TOMCAT, I set the "max"
> parameter behind ProxyPass
>               ProxyPass /jspdir ajp://localhost:8009/jspdir max=10
> 
> I run test again, and errors occured again. I used "netstat -an" to
> see how many connections to localhost:8009. And I found the number of
> connections are greater than 10!!!
> 
> So is the "max" parameter useless for proxy_ajp connection? Any
> suggestions of configuration?

Apart from the fact that I think that these questions belong to the users list:

max ensures that not more then max connections get created *per* Apache child process.

So the questions are

1. What MPM do you use?
2. What is your setting for ServerLimit?

Provided that you use the worker MPM the maximum number of total connections
httpd creates is max * ServerLimit.

Regards

RĂ¼diger