You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nicolas Sarazin <ni...@gmail.com> on 2012/09/20 16:37:26 UTC

mod_jk/1.2.32 - Error connecting to Tomcat only on one page

Hello all,

English is not my native language, please excuse typing errors.

I met a problem which I do not manage to explain...

My environement (one server) :

Server version : Apache Tomcat/5.5.26
Server built : Jan 28 2008 01:35:23
Server number : 5.5.26.0
OS Name : Linux (Red Hat Enterprise Linux Server release 5.2 (Tikanga))
OS Version : 2.6.18-92.el5
Architecture : i386
JVM Version : 1.6.0_06-b02
JVM Vendor : Sun Microsystems Inc.
Web server version : Apache/2.2.21 (Unix) mod_jk/1.2.32

Web server communicate with application server by AJP/13, module
mo_jk. My configuration :

Server.xml :

[...]
    <!-- Define an AJP 1.3 Connector on port 8011 -->
    <Connector port="8011"
               enableLookups="false" redirectPort="8443" debug="0"
               maxThreads="600" keepAlive="true" backlog="8192"
               minSpareThreads="25" maxSpareThreads="250"
               connectionTimeout="600000" protocol="AJP/1.3" />
[...]

worker.properties :

# define worker
worker.list=ajp13

# Set properties for ajp13 => tomcat
worker.ajp13.type=ajp13
worker.ajp13.host=localhost
worker.ajp13.port=8011
worker.ajp13.connection_pool_size=1200
worker.ajp13.connection_pool_timeout=600
worker.ajp13.socket_keepalive=true
worker.ajp13.socket_timeout=600

My VirtualHost :

[...]
  JkMount /* ajp13
[...]

Usually, it's work correctly, but sometime, only on certain pages,
woker can't connect to Tomcat. In my logs files, I have :

mod_jk.log :

[...]
[Wed Sep 19 19:23:05 2012][2923:47030846901328] [error]
ajp_service::jk_ajp_common.c (2626): (ajp13) connecting to tomcat
failed.
[Wed Sep 19 19:26:21 2012][2956:47030846901328] [error]
ajp_service::jk_ajp_common.c (2626): (ajp13) connecting to tomcat
failed.
[Wed Sep 19 19:26:27 2012][1941:47030846901328] [error]
ajp_service::jk_ajp_common.c (2626): (ajp13) connecting to tomcat
failed.
[Wed Sep 19 19:26:27 2012][2917:47030846901328] [error]
ajp_service::jk_ajp_common.c (2626): (ajp13) connecting to tomcat
failed.
[Wed Sep 19 19:26:28 2012][1821:47030846901328] [error]
ajp_service::jk_ajp_common.c (2626): (ajp13) connecting to tomcat
failed.
[Wed Sep 19 19:26:29 2012][2906:47030846901328] [error]
ajp_service::jk_ajp_common.c (2626): (ajp13) connecting to tomcat
failed.
[...]
[Wed Sep 19 19:27:11 2012][2926:47030846901328] [error]
ajp_service::jk_ajp_common.c (2626): (ajp13) connecting to tomcat
failed.
[...]

VirtualHost log file :

[...]
ipuser1 - - [19/Sep/2012:19:26:06 +0200] "GET /page1 HTTP/1.1" 200
49467 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR
3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" 162574
ipuser1 - - [19/Sep/2012:19:26:21 +0200] "GET /page2 HTTP/1.1" 500 21
"http://servername/page1" "Mozilla/4.0 (compatible; MSIE 7.0; Windows
NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET
CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" 104361
ipuser1 - - [19/Sep/2012:19:26:26 +0200] "GET /page2 HTTP/1.1" 500 21
"-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0;
.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648;
.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" 105824
ipuser1 - - [19/Sep/2012:19:26:27 +0200] "GET /page2 HTTP/1.1" 500 21
"-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0;
.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648;
.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" 105062
ipuser1 - - [19/Sep/2012:19:26:28 +0200] "GET /page2 HTTP/1.1" 500 21
"-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0;
.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648;
.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" 106297
ipuser1 - - [19/Sep/2012:19:26:29 +0200] "GET /page2 HTTP/1.1" 500 21
"-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0;
.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648;
.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" 105792
ipuser1 - - [19/Sep/2012:19:26:30 +0200] "GET /page2 HTTP/1.1" 500 21
"-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0;
.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648;
.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" 104940
[...]
ipuser1 - - [19/Sep/2012:19:27:08 +0200] "GET /page1 HTTP/1.1" 200
49095 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR
3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" 352904
ipuser1 - - [19/Sep/2012:19:27:11 +0200] "GET /page2 HTTP/1.1" 500 21
"http://servername/page1" "Mozilla/4.0 (compatible; MSIE 7.0; Windows
NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET
CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)" 105703
ipuser1 - - [19/Sep/2012:19:27:17 +0200] "GET /page3 HTTP/1.1" 200
8882 "http://servername/page1" "Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR
3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR
3.5.30729)" 411922
[...]

Take a look on requested pages :
- request on "/page1" return HTTP code 200
- request on "/page2" return HTTP code 500, and an error message is
logged in mod_jk.log
- request on "/page3" return HTTP code 200

I haven't error in application server logs.

At the beginning, I thought that the problem came from a bad
configuration here :
In server.xml file : maxThreads="600"
In worker.properties : worker.ajp13.connection_pool_size=1200

But at the present time, there was no overload on the servers.

How can we explain this behavior ?

Thank you in advance !

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


Re: mod_jk/1.2.32 - Error connecting to Tomcat only on one page

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nicholas,

On 10/2/12 10:58 AM, Nicolas Sarazin wrote:
> I want to update Apache with 2.4.2 version. But, on mod_jk download
> page, we have only "mod_jk-1.2.32-httpd-2.2.21-nw.zip" (for httpd
> 2.2.21).
> 
> Is it compatible with Apache httpd 2.4.2 ?

Maybe, maybe not. ASF no longer provides binary releases of mod_jk for
*NIX systems: you'll have to get a binary yourself.

The latest mod_jk is 1.2.37.

If your package maintainer does not include mod_jk (e.g. Red Hat),
then you'll have to build it yourself.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBrIAoACgkQ9CaO5/Lv0PDVOgCgg8UYUZGKLEA6Sagegzq7u4vQ
9GIAnA06isgWL4rYNFF3ZxcWFmZXKkst
=bMYm
-----END PGP SIGNATURE-----

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


Re: mod_jk/1.2.32 - Error connecting to Tomcat only on one page

Posted by Nicolas Sarazin <ni...@gmail.com>.
Hello,

I want to update Apache with 2.4.2 version. But, on mod_jk download page,
we have only "mod_jk-1.2.32-httpd-2.2.21-nw.zip" (for httpd 2.2.21).

Is it compatible with Apache httpd 2.4.2 ?

Thanks in advance,

Nicolas SARAZIN

2012/9/24 Nicolas Sarazin <ni...@gmail.com>:
> Hi Christopher,
>
> And thank you for this invaluable information !
>
> I shall continue the discussion if the problem persists after the
> update of my configuration.
>
> Nicolas SARAZIN
>
> 2012/9/21 Christopher Schultz <ch...@christopherschultz.net>:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Nicholas,
>>
>> On 9/21/12 4:14 AM, Nicolas Sarazin wrote:
>>> Ok for all versions upgrades, I put it in my todo list ! It is a
>>> customer environment, I can't make it immediately.
>>
>> That's okay, but you need to be ready when your customer says "hey,
>> Tomcat 5.5.x is no longer supported: we need to upgrade".
>>
>>>> Christopher Schultz wrote:
>>>>
>>>> Do you have anything else? If not, why bother with Apache httpd?
>>>
>>> Yes, we have lot of directives (using mod_cache, mod_proxy, ...).
>>> In reality, I have about twenty VirtualHost.
>>
>> Fair enough: it's always worth asking. Lots of people think that
>> Apache httpd is, for some reason, required.
>>
>>>> What MPM are you using? If you are using prefork, then your
>>>> connection_pool_size is all wrong. Generally speaking, you
>>>> should allow mod_jk to determine its own value for
>>>> connection_pool_size when using Apache httpd.
>>>>
>>>> How many backend Tomcat servers do you have? Looks like one.
>>>>
>>>> Let's assume you are using threaded MPM in httpd (otherwise the
>>>> value for 1200 is insane) and you are using only one backend
>>>> Tomcat server.
>>>>
>>>> You have 1200 connections configured in httpd
>>>> (connection_pool_size), but Tomcat can only accept 600 of them
>>>> (maxThreads) at any given time. You have used backlog=8192 to
>>>> cover this up so things become even more confusing.
>>>
>>> I using prefork. Indeed, in Apache documentation : "Do not use
>>> connection_pool_size with values higher then 1 on Apache 2.x
>>> prefork or Apache 1.3.x!". It's better to delete it or to put its
>>> value to 1 ?
>>
>> I would delete the option altogether - per the documentation - and
>> allow mod_jk to select the appropriate setting.
>>
>>> What problems can arise with mpm prefork and connection_pool_size >
>>> 1 ?
>>
>> A big waste of memory and a lot of needless overhead. I dunno how
>> mod_jk manages its connections, but it might immediately open 1200
>> connections per prefork process to your backend, which can waste a lot
>> of resources, too.
>>
>>>>> Usually, it's work correctly, but sometime, only on certain
>>>>> pages, woker can't connect to Tomcat. In my logs files, I have
>>>>> :
>>>>
>>>> I think it's only a coincidence that /page2 consistently gives
>>>> you 500-response errors, here. Try looking at a wider section of
>>>> your httpd access log to determine if there really is something
>>>> special about /page2 (of course, /page2 could be returning
>>>> 500-response itself: you might want to check on that).
>>>
>>> This page was in error 500 in acces log between 19:12:27 and
>>> 20:04:39.
>>>
>>>>> How can we explain this behavior ?
>>>>
>>>> There are lots of explanations for what you are seeing.
>>>>
>>>> A few questions:
>>>>
>>>> 1. Do you really need Apache httpd at all? 2. Can you configure
>>>> cping/cpong for connection liveness testing? 3. Have you tried
>>>> disabling AJP connection re-use altogether? localhost
>>>> communication is fast fast fast.
>>>
>>> 1 - Yes :) 2 - Yes, but not immediately 3 - I don't, but I am going
>>> to test !
>>
>> Good luck.
>>
>> - -chris
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
>> Comment: GPGTools - http://gpgtools.org
>> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>>
>> iEYEARECAAYFAlBc4BMACgkQ9CaO5/Lv0PA/8gCgm0FxMnBA7t5lxZzB5t5rZMPg
>> tAkAniqoOQWd7ttK+COk9w0I1g9HHt6R
>> =59/Q
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>

Re: mod_jk/1.2.32 - Error connecting to Tomcat only on one page

Posted by Nicolas Sarazin <ni...@gmail.com>.
Hi Christopher,

And thank you for this invaluable information !

I shall continue the discussion if the problem persists after the
update of my configuration.

Nicolas SARAZIN

2012/9/21 Christopher Schultz <ch...@christopherschultz.net>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Nicholas,
>
> On 9/21/12 4:14 AM, Nicolas Sarazin wrote:
>> Ok for all versions upgrades, I put it in my todo list ! It is a
>> customer environment, I can't make it immediately.
>
> That's okay, but you need to be ready when your customer says "hey,
> Tomcat 5.5.x is no longer supported: we need to upgrade".
>
>>> Christopher Schultz wrote:
>>>
>>> Do you have anything else? If not, why bother with Apache httpd?
>>
>> Yes, we have lot of directives (using mod_cache, mod_proxy, ...).
>> In reality, I have about twenty VirtualHost.
>
> Fair enough: it's always worth asking. Lots of people think that
> Apache httpd is, for some reason, required.
>
>>> What MPM are you using? If you are using prefork, then your
>>> connection_pool_size is all wrong. Generally speaking, you
>>> should allow mod_jk to determine its own value for
>>> connection_pool_size when using Apache httpd.
>>>
>>> How many backend Tomcat servers do you have? Looks like one.
>>>
>>> Let's assume you are using threaded MPM in httpd (otherwise the
>>> value for 1200 is insane) and you are using only one backend
>>> Tomcat server.
>>>
>>> You have 1200 connections configured in httpd
>>> (connection_pool_size), but Tomcat can only accept 600 of them
>>> (maxThreads) at any given time. You have used backlog=8192 to
>>> cover this up so things become even more confusing.
>>
>> I using prefork. Indeed, in Apache documentation : "Do not use
>> connection_pool_size with values higher then 1 on Apache 2.x
>> prefork or Apache 1.3.x!". It's better to delete it or to put its
>> value to 1 ?
>
> I would delete the option altogether - per the documentation - and
> allow mod_jk to select the appropriate setting.
>
>> What problems can arise with mpm prefork and connection_pool_size >
>> 1 ?
>
> A big waste of memory and a lot of needless overhead. I dunno how
> mod_jk manages its connections, but it might immediately open 1200
> connections per prefork process to your backend, which can waste a lot
> of resources, too.
>
>>>> Usually, it's work correctly, but sometime, only on certain
>>>> pages, woker can't connect to Tomcat. In my logs files, I have
>>>> :
>>>
>>> I think it's only a coincidence that /page2 consistently gives
>>> you 500-response errors, here. Try looking at a wider section of
>>> your httpd access log to determine if there really is something
>>> special about /page2 (of course, /page2 could be returning
>>> 500-response itself: you might want to check on that).
>>
>> This page was in error 500 in acces log between 19:12:27 and
>> 20:04:39.
>>
>>>> How can we explain this behavior ?
>>>
>>> There are lots of explanations for what you are seeing.
>>>
>>> A few questions:
>>>
>>> 1. Do you really need Apache httpd at all? 2. Can you configure
>>> cping/cpong for connection liveness testing? 3. Have you tried
>>> disabling AJP connection re-use altogether? localhost
>>> communication is fast fast fast.
>>
>> 1 - Yes :) 2 - Yes, but not immediately 3 - I don't, but I am going
>> to test !
>
> Good luck.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iEYEARECAAYFAlBc4BMACgkQ9CaO5/Lv0PA/8gCgm0FxMnBA7t5lxZzB5t5rZMPg
> tAkAniqoOQWd7ttK+COk9w0I1g9HHt6R
> =59/Q
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

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


Re: mod_jk/1.2.32 - Error connecting to Tomcat only on one page

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nicholas,

On 9/21/12 4:14 AM, Nicolas Sarazin wrote:
> Ok for all versions upgrades, I put it in my todo list ! It is a 
> customer environment, I can't make it immediately.

That's okay, but you need to be ready when your customer says "hey,
Tomcat 5.5.x is no longer supported: we need to upgrade".

>> Christopher Schultz wrote:
>> 
>> Do you have anything else? If not, why bother with Apache httpd?
> 
> Yes, we have lot of directives (using mod_cache, mod_proxy, ...).
> In reality, I have about twenty VirtualHost.

Fair enough: it's always worth asking. Lots of people think that
Apache httpd is, for some reason, required.

>> What MPM are you using? If you are using prefork, then your 
>> connection_pool_size is all wrong. Generally speaking, you
>> should allow mod_jk to determine its own value for
>> connection_pool_size when using Apache httpd.
>> 
>> How many backend Tomcat servers do you have? Looks like one.
>> 
>> Let's assume you are using threaded MPM in httpd (otherwise the
>> value for 1200 is insane) and you are using only one backend
>> Tomcat server.
>> 
>> You have 1200 connections configured in httpd
>> (connection_pool_size), but Tomcat can only accept 600 of them
>> (maxThreads) at any given time. You have used backlog=8192 to
>> cover this up so things become even more confusing.
> 
> I using prefork. Indeed, in Apache documentation : "Do not use 
> connection_pool_size with values higher then 1 on Apache 2.x
> prefork or Apache 1.3.x!". It's better to delete it or to put its
> value to 1 ?

I would delete the option altogether - per the documentation - and
allow mod_jk to select the appropriate setting.

> What problems can arise with mpm prefork and connection_pool_size >
> 1 ?

A big waste of memory and a lot of needless overhead. I dunno how
mod_jk manages its connections, but it might immediately open 1200
connections per prefork process to your backend, which can waste a lot
of resources, too.

>>> Usually, it's work correctly, but sometime, only on certain
>>> pages, woker can't connect to Tomcat. In my logs files, I have
>>> :
>> 
>> I think it's only a coincidence that /page2 consistently gives
>> you 500-response errors, here. Try looking at a wider section of
>> your httpd access log to determine if there really is something
>> special about /page2 (of course, /page2 could be returning
>> 500-response itself: you might want to check on that).
> 
> This page was in error 500 in acces log between 19:12:27 and
> 20:04:39.
> 
>>> How can we explain this behavior ?
>> 
>> There are lots of explanations for what you are seeing.
>> 
>> A few questions:
>> 
>> 1. Do you really need Apache httpd at all? 2. Can you configure
>> cping/cpong for connection liveness testing? 3. Have you tried
>> disabling AJP connection re-use altogether? localhost
>> communication is fast fast fast.
> 
> 1 - Yes :) 2 - Yes, but not immediately 3 - I don't, but I am going
> to test !

Good luck.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBc4BMACgkQ9CaO5/Lv0PA/8gCgm0FxMnBA7t5lxZzB5t5rZMPg
tAkAniqoOQWd7ttK+COk9w0I1g9HHt6R
=59/Q
-----END PGP SIGNATURE-----

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


Re: mod_jk/1.2.32 - Error connecting to Tomcat only on one page

Posted by Nicolas Sarazin <ni...@gmail.com>.
Christopher,

Thank you for this fast answer !

Ok for all versions upgrades, I put it in my todo list ! It is a
customer environment, I can't make it immediately.

>> My VirtualHost :
>>
>> [...] JkMount /* ajp13 [...]
>
> Do you have anything else? If not, why bother with Apache httpd?

Yes, we have lot of directives (using mod_cache, mod_proxy, ...). In
reality, I have about twenty VirtualHost.

>> [...] <!-- Define an AJP 1.3 Connector on port 8011 --> <Connector
>> port="8011" enableLookups="false" redirectPort="8443" debug="0"
>> maxThreads="600" keepAlive="true" backlog="8192"
>> minSpareThreads="25" maxSpareThreads="250"
>> connectionTimeout="600000" protocol="AJP/1.3" /> [...]
>
> That's a huge backlog, especially when you always expect a certain
> maximum number of connections coming from Apache httpd.

Ok for "backlog". I delete it as soon as possible.

>> worker.properties :
>>
>> # define worker worker.list=ajp13
>>
>> # Set properties for ajp13 => tomcat worker.ajp13.type=ajp13
>> worker.ajp13.host=localhost worker.ajp13.port=8011
>> worker.ajp13.connection_pool_size=1200
>> worker.ajp13.connection_pool_timeout=600
>> worker.ajp13.socket_keepalive=true worker.ajp13.socket_timeout=600
>
> What MPM are you using? If you are using prefork, then your
> connection_pool_size is all wrong. Generally speaking, you should
> allow mod_jk to determine its own value for connection_pool_size when
> using Apache httpd.
>
> How many backend Tomcat servers do you have? Looks like one.
>
> Let's assume you are using threaded MPM in httpd (otherwise the value
> for 1200 is insane) and you are using only one backend Tomcat server.
>
> You have 1200 connections configured in httpd (connection_pool_size),
> but Tomcat can only accept 600 of them (maxThreads) at any given time.
> You have used backlog=8192 to cover this up so things become even more
> confusing.

I using prefork. Indeed, in Apache documentation : "Do not use
connection_pool_size with values higher then 1 on Apache 2.x prefork
or Apache 1.3.x!". It's better to delete it or to put its value to 1 ?
What problems can arise with mpm prefork and connection_pool_size > 1
?

>> Usually, it's work correctly, but sometime, only on certain pages,
>> woker can't connect to Tomcat. In my logs files, I have :
>
> I think it's only a coincidence that /page2 consistently gives you
> 500-response errors, here. Try looking at a wider section of your
> httpd access log to determine if there really is something special
> about /page2 (of course, /page2 could be returning 500-response
> itself: you might want to check on that).

This page was in error 500 in acces log between 19:12:27 and 20:04:39.

>> How can we explain this behavior ?
>
> There are lots of explanations for what you are seeing.
>
> A few questions:
>
> 1. Do you really need Apache httpd at all?
> 2. Can you configure cping/cpong for connection liveness testing?
> 3. Have you tried disabling AJP connection re-use altogether?
>    localhost communication is fast fast fast.

1 - Yes :)
2 - Yes, but not immediately
3 - I don't, but I am going to test !

Thank you !


2012/9/20 Christopher Schultz <ch...@christopherschultz.net>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Nicolas,
>
> On 9/20/12 10:37 AM, Nicolas Sarazin wrote:
>> English is not my native language, please excuse typing errors.
>
> Welcome!
>
>> I met a problem which I do not manage to explain...
>>
>> My environment (one server) :
>>
>> Server version : Apache Tomcat/5.5.26
>
> You have 10 days to upgrade, at which point you will be flying without
> a parachute: Apache support for Tomcat 5.5.x expires in 10 days. I
> highly recommend that you get Tomcat 7 or at least Tomcat 6 into your
> test environments ASAP.
>
>> JVM Version : 1.6.0_06-b02
>
> You could afford to upgrade that, too. Oracle is on 1.6.0_35.
>
>> Web server version : Apache/2.2.21 (Unix) mod_jk/1.2.32
>
> 2.2.23 and 1.2.37
>
>> My VirtualHost :
>>
>> [...] JkMount /* ajp13 [...]
>
> Do you have anything else? If not, why bother with Apache httpd?
>
>> [...] <!-- Define an AJP 1.3 Connector on port 8011 --> <Connector
>> port="8011" enableLookups="false" redirectPort="8443" debug="0"
>> maxThreads="600" keepAlive="true" backlog="8192"
>> minSpareThreads="25" maxSpareThreads="250"
>> connectionTimeout="600000" protocol="AJP/1.3" /> [...]
>
> That's a huge backlog, especially when you always expect a certain
> maximum number of connections coming from Apache httpd.
>
>> worker.properties :
>>
>> # define worker worker.list=ajp13
>>
>> # Set properties for ajp13 => tomcat worker.ajp13.type=ajp13
>> worker.ajp13.host=localhost worker.ajp13.port=8011
>> worker.ajp13.connection_pool_size=1200
>> worker.ajp13.connection_pool_timeout=600
>> worker.ajp13.socket_keepalive=true worker.ajp13.socket_timeout=600
>
> What MPM are you using? If you are using prefork, then your
> connection_pool_size is all wrong. Generally speaking, you should
> allow mod_jk to determine its own value for connection_pool_size when
> using Apache httpd.
>
> How many backend Tomcat servers do you have? Looks like one.
>
> Let's assume you are using threaded MPM in httpd (otherwise the value
> for 1200 is insane) and you are using only one backend Tomcat server.
>
> You have 1200 connections configured in httpd (connection_pool_size),
> but Tomcat can only accept 600 of them (maxThreads) at any given time.
> You have used backlog=8192 to cover this up so things become even more
> confusing.
>
>> Usually, it's work correctly, but sometime, only on certain pages,
>> woker can't connect to Tomcat. In my logs files, I have :
>
> I think it's only a coincidence that /page2 consistently gives you
> 500-response errors, here. Try looking at a wider section of your
> httpd access log to determine if there really is something special
> about /page2 (of course, /page2 could be returning 500-response
> itself: you might want to check on that).
>
>> At the beginning, I thought that the problem came from a bad
>> configuration here : In server.xml file : maxThreads="600" In
>> worker.properties : worker.ajp13.connection_pool_size=1200
>>
>> But at the present time, there was no overload on the servers.
>
> You should really get your connection allocations straightened-out,
> even if you don't expect them to be a problem. If you expect 1200
> connections from httpd, then set maxThreads=1200 in Tomcat. I see you
> have the same timeout values for both sides of the connection (good!).
> You don't need that insanely-high TCP backlog, so remove that, too.
>
>> How can we explain this behavior ?
>
> There are lots of explanations for what you are seeing.
>
> A few questions:
>
> 1. Do you really need Apache httpd at all?
> 2. Can you configure cping/cpong for connection liveness testing?
> 3. Have you tried disabling AJP connection re-use altogether?
>    localhost communication is fast fast fast.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iEYEARECAAYFAlBbOikACgkQ9CaO5/Lv0PDhEwCfdEvr3VNpF/IEUvNlEzKD6qzN
> 1AsAoMQKM5BJXP/6etm2MsPbL3H32OOu
> =02al
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

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


Re: mod_jk/1.2.32 - Error connecting to Tomcat only on one page

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nicolas,

On 9/20/12 10:37 AM, Nicolas Sarazin wrote:
> English is not my native language, please excuse typing errors.

Welcome!

> I met a problem which I do not manage to explain...
> 
> My environment (one server) :
> 
> Server version : Apache Tomcat/5.5.26

You have 10 days to upgrade, at which point you will be flying without
a parachute: Apache support for Tomcat 5.5.x expires in 10 days. I
highly recommend that you get Tomcat 7 or at least Tomcat 6 into your
test environments ASAP.

> JVM Version : 1.6.0_06-b02

You could afford to upgrade that, too. Oracle is on 1.6.0_35.

> Web server version : Apache/2.2.21 (Unix) mod_jk/1.2.32

2.2.23 and 1.2.37

> My VirtualHost :
> 
> [...] JkMount /* ajp13 [...]

Do you have anything else? If not, why bother with Apache httpd?

> [...] <!-- Define an AJP 1.3 Connector on port 8011 --> <Connector
> port="8011" enableLookups="false" redirectPort="8443" debug="0" 
> maxThreads="600" keepAlive="true" backlog="8192" 
> minSpareThreads="25" maxSpareThreads="250" 
> connectionTimeout="600000" protocol="AJP/1.3" /> [...]

That's a huge backlog, especially when you always expect a certain
maximum number of connections coming from Apache httpd.

> worker.properties :
> 
> # define worker worker.list=ajp13
> 
> # Set properties for ajp13 => tomcat worker.ajp13.type=ajp13 
> worker.ajp13.host=localhost worker.ajp13.port=8011 
> worker.ajp13.connection_pool_size=1200 
> worker.ajp13.connection_pool_timeout=600 
> worker.ajp13.socket_keepalive=true worker.ajp13.socket_timeout=600

What MPM are you using? If you are using prefork, then your
connection_pool_size is all wrong. Generally speaking, you should
allow mod_jk to determine its own value for connection_pool_size when
using Apache httpd.

How many backend Tomcat servers do you have? Looks like one.

Let's assume you are using threaded MPM in httpd (otherwise the value
for 1200 is insane) and you are using only one backend Tomcat server.

You have 1200 connections configured in httpd (connection_pool_size),
but Tomcat can only accept 600 of them (maxThreads) at any given time.
You have used backlog=8192 to cover this up so things become even more
confusing.

> Usually, it's work correctly, but sometime, only on certain pages, 
> woker can't connect to Tomcat. In my logs files, I have :

I think it's only a coincidence that /page2 consistently gives you
500-response errors, here. Try looking at a wider section of your
httpd access log to determine if there really is something special
about /page2 (of course, /page2 could be returning 500-response
itself: you might want to check on that).

> At the beginning, I thought that the problem came from a bad 
> configuration here : In server.xml file : maxThreads="600" In
> worker.properties : worker.ajp13.connection_pool_size=1200
> 
> But at the present time, there was no overload on the servers.

You should really get your connection allocations straightened-out,
even if you don't expect them to be a problem. If you expect 1200
connections from httpd, then set maxThreads=1200 in Tomcat. I see you
have the same timeout values for both sides of the connection (good!).
You don't need that insanely-high TCP backlog, so remove that, too.

> How can we explain this behavior ?

There are lots of explanations for what you are seeing.

A few questions:

1. Do you really need Apache httpd at all?
2. Can you configure cping/cpong for connection liveness testing?
3. Have you tried disabling AJP connection re-use altogether?
   localhost communication is fast fast fast.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBbOikACgkQ9CaO5/Lv0PDhEwCfdEvr3VNpF/IEUvNlEzKD6qzN
1AsAoMQKM5BJXP/6etm2MsPbL3H32OOu
=02al
-----END PGP SIGNATURE-----

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