0

I have an linux server running with a JBoss Instance with apache2. Apache2 will use AJP connection to reverse proxy to JBoss.

I found these messages in the apache error.log:

[error] (70007)The timeout specified has expired: ajp_ilink_receive() can't receive header
[error] ajp_read_header: ajp_ilink_receive failed
[error] (120006)APR does not understand this error code: proxy: read response failed from 8.8.8.8:8009 (hostname)
[error] (111)Connection refused: proxy: AJP: attempt to connect to 8.8.8.8:8009 (hostname) failed
[error] ap_proxy_connect_backend disabling worker for (hostname)
[error] proxy: AJP: failed to make connection to backend: hostname
[error] proxy: AJP: disabled connection for (hostname)25

I googled around but I can't seem to find any related topics. There are people say this behavior can be caused by misconfigured apache vs jboss. Telling the max amount of connections apache allows are far greater then jboss, causing the apache connection to time out.

But I know the app isn't used by thousands of simultaneous connections at the time not even hundreds of connections so I don't believe this could be a cause.

Does anybody have an idea? Or could tell me how to debug this problem?

I'm using these versions:

  • Debian 4.3.5-4 64Bit
  • Apache Version 2.2.16
  • JBOSS Version 4.2.3.GA

Thanks

Niels
  • 771
  • 2
  • 8
  • 8

3 Answers3

2

4.2.3 jboss, you should increase the amount of ajp connections that you can allow in server.xml. if that is not set, the default is 40, which is too low. Up that to 20% higher than your current amount of max connections. If you have hundreds of simutanious connections, set it to 512 and monitor it using the status console.

1

Here is what made jb7.1.1 work with apache mod_jk connecting trough ajp in my env:

standalone.xml

<profile>

...

<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
           ...
            <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>
....
        </subsystem>
....

</profile>


<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        ...
        <socket-binding name="ajp" port="8009"/>
        ...
</socket-binding-group>

BTW 8.8.8.8 isn't this google dns?

radoslawc
  • 51
  • 3
  • Yes, it's google's DNS I used it to mask my server ip ;) I think mod_jk doesn't work with this version of JBOSS which version are you using ? – Niels Oct 09 '12 at 07:47
  • 7.1.1 also 7.1.0 and 7.0.2 on different servers, each with apache frontend and mod_jk (which seems to be obsolete, and mod_cluster is somewhat better, I'll have to investigate this). But so far it works. – radoslawc Oct 09 '12 at 11:21
1

I believe the behaviour you're seeing could be caused by the following jboss issue:

https://issues.jboss.org/browse/JBPAPP-366

The issue causes AJP threads to block indefinitely on sockets with CLOSED_WAIT status. When the "maxProcessors" limit from the AJP connector is reached then jboss isn't able to answer any more requests through AJP, causing the errors you got in the apache log.

As suggested in the ticket, that can be solved in a few steps:

  • checkout jbossweb from http://anonsvn.jboss.org/repos/jbossweb/tags/JBOSSWEB_2_0_1_GA
  • apply AjpPatch.patch as suggested in the comments thread at the jboss issue tracker
  • edit build.properties.default so that jbossweb is built agains your version of jboss AS
  • build the project with ant and replace your current jboss-web.deployer/jbossweb with the patched version
ruisalgado
  • 11
  • 1