httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ângelo Vimeney" <avime...@gmail.com>
Subject [users@httpd] Apache, Tomcat and mod_proxy
Date Thu, 06 Dec 2007 18:27:29 GMT
Hello everybody,

I'm experiencing problems using the Apache server as a proxy to my
Tomcat server and I will appreciate if somebody could help me. Please,
take my apologies for my poor English and long mail.

I'm using Apache version 2.2.6 installed on a dedicated HTTP server
machine (running Linux 2.6.9-34.EL). I'm using Tomcat version 6.0.14
installed on another dedicated server machine (running Linux
2.6.9-34.EL). I have also a remote browser emulator running on another
dedicated machine. The emulated browsers access an e-commerce site
deployed at the Tomcat server (I'm running the TPC-W benchmark).

When I simulate 25 browsers accessing Apache, everything works fine.
But when I increase this value to 50, after 5 minutes of simulation,
the following error message is logged at the Apache's error_log file:

[Tue Dec 04 16:47:17 2007] [notice] Apache/2.2.6 (Unix) configured --
resuming normal operations
[Tue Dec 04 16:53:08 2007] [error] (70007)The timeout specified has
expired: ajp_ilink_receive() can't receive header
[Tue Dec 04 16:53:08 2007] [error] ajp_read_header: ajp_ilink_receive failed
[Tue Dec 04 16:53:08 2007] [error] (120006)APR does not understand
this error code: proxy: read response failed from 10.10.20.246:8009
(compute-0-0)
[Tue Dec 04 16:53:08 2007] [error] (70007)The timeout specified has
expired: ajp_ilink_receive() can't receive header
[Tue Dec 04 16:53:08 2007] [error] ajp_read_header: ajp_ilink_receive failed
[Tue Dec 04 16:53:08 2007] [error] (120006)APR does not understand
this error code: proxy: read response failed from 10.10.20.246:8009
(compute-0-0)
...

At the Tomcat's catalina.out I found the following log:

...
Dec 4, 2007 4:47:49 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3549 ms
Dec 4, 2007 4:53:51 PM org.apache.jk.core.MsgContext action
WARNING: Error sending end packet
java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
        at org.apache.jk.common.ChannelSocket.send(ChannelSocket.java:531)
        at org.apache.jk.common.JkInputStream.endMessage(JkInputStream.java:121)
        at org.apache.jk.core.MsgContext.action(MsgContext.java:301)
        at org.apache.coyote.Response.action(Response.java:183)
        at org.apache.coyote.Response.finish(Response.java:305)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:195)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        at java.lang.Thread.run(Thread.java:595)
Dec 4, 2007 4:53:51 PM org.apache.jk.common.ChannelSocket processConnection
WARNING: processCallbacks status 2
Dec 4, 2007 4:53:56 PM org.apache.jk.core.MsgContext action
WARNING: Error sending end packet
java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
        at org.apache.jk.common.ChannelSocket.send(ChannelSocket.java:531)
        at org.apache.jk.common.JkInputStream.endMessage(JkInputStream.java:121)
        at org.apache.jk.core.MsgContext.action(MsgContext.java:301)
        at org.apache.coyote.Response.action(Response.java:183)
        at org.apache.coyote.Response.finish(Response.java:305)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:195)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        at java.lang.Thread.run(Thread.java:595)
...

I have successfully build my Apache using:

configure --enable-modules='proxy proxy_ajp proxy_balancer'
make
make install

I added to the original httpd.conf the followings configurations:

ProxyRequests Off

<Location /tpcw>
    ProxyPass balancer://tomcatCluster/tpcw stickysession=JSESSIONID
nofailover=On timeout=60
    ProxyPassReverse balancer://tomcatCluster/tpcw
</Location>

<Proxy balancer://tomcatCluster>
    BalancerMember ajp://compute-0-0:8009  route=tomcat1
</Proxy>

ServerLimit 75
MaxClients 75


In the Tomcat's server.xml, I'm using:

<Connector port="8009" enableLookups="false" redirectPort="8443"
       protocol="AJP/1.3" maxThreads="75"
       minSpareThreads="50"
       maxSpareThreads="50"/>

<Engine name="Standalone" defaultHost="localhost" jvmRoute="tomcat1">


After the error, both Apache and Tomcat still working fine, but the
error makes my simulation's results unreliable. Note that, when I use
the mod_jk instead of mod_proxy, no problems arise, not even with more
than 50 emulated browsers. Is that some configuration problem?? Any
suggestions?

Thanks in advance,
Ângelo Vimeney

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message