Re: mod_jk/1.2.32 - Error connecting to Tomcat only on one page
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 nicolas.sarazin@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-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: mod_jk/1.2.32 - Error connecting to Tomcat only on one page
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-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: mod_jk/1.2.32 - Error connecting to Tomcat only on one page
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=60 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=60 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
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=60 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 [...]
Re: Sticky sessions not working
Hello, Add : worker.node1.route=node1 And : worker.node2.route=node2 To use sticky session. These directives attach name route at the end of JSESSIONID. Best regards, Nicolas SARAZIN Le vendredi 21 septembre 2012, Lou Henry a écrit : I'm running Apache Tomcat 7.0.14 and Apache 2.2.21 (mod_jk1.2.37). I am trying to load balance two Tomcat Servers and sticky sessions are not working. I am running a two-factor authentication package and it looks like my LB configuration is directing the user to one Tomcat for part of the transaction and to the other Tomcat server for the other part. When I bring down one of the Tomcat servers, everything works fine; but with both Tomcat servers up, I get 500 errors. So, I am trying to stick the webserver session to one particular Tomcat server. Listed below is my configuration. Also, I tried without the domain directive also. I am not quite sure if that's a random name or should it be something specific. Can someone please assist? Thank you... *workers.properties* worker.list=loadbalancer,status # Define Node1 # modify the host as your host IP or DNS name. worker.node1.domain=jvm1 worker.node1.port= worker.node1.host=t*20.x. worker.node1.type=ajp13 worker.node1.lbfactor=1 worker.node1.ping_mode=A # Define Node2 # modify the host as your host IP or DNS name. worker.node2.domain=jvm2 worker.node2.port= worker.node2.host=t*21.x. worker.node2.type=ajp13 worker.node2.lbfactor=1 worker.node2.ping_mode=A # Load-balancing behaviour worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=node1,node2 worker.loadbalancer.sticky_session=True # Status worker for managing load balancer worker.status.type=status # Added per Anakam direction 113010 worker.node1.socket_keepalive=True worker.node1.socket_timeout=300 # Added per Anakam direction 113010 worker.node2.socket_keepalive=True worker.node2.socket_keepalive=300 *server.xml on Tomcat Node 1* Engine name=Catalina defaultHost=localhost jvmRoute=node1 *server.xml on Tomcat Node 2* Engine name=Catalina defaultHost=localhost jvmRoute=node2