mod_jk hangs
Just yesterday we started running into problems requesting pages on our production website through mod_jk. Previously everything had been working fine for months. Essentially what happens is when you request the page for the first time (doesn't seem to matter what browser you're using) the browser just sits and spins. Then after hitting refresh (Ctrl+R) a couple times it finally comes up. Subsequent visits to the same page continue to work for me in Mozilla but after closing IE and reopening it after a couple more requests it hangs again. In case it helps, the site in question is http://www.atmreports.com. I simply cannot figure out what is going on. I do see many errors in the mod_jk.log, but these had been there before when everything worked fine too: [Wed May 05 09:27:46 2004] [jk_ajp_common.c (1137)]: Error reading reply from tomcat. Tomcat is down or network problems. [Wed May 05 09:27:46 2004] [jk_ajp_common.c (1290)]: ERROR: Receiving from tomcat failed, recoverable operation. err=0 [Wed May 05 09:27:46 2004] [jk_ajp_common.c (1309)]: sending request to tomcat failed in send loop. err=0 [Wed May 05 09:27:46 2004] [jk_ajp_common.c (738)]: ERROR: can't receive the response message from tomcat, network problems or tomcat is down. err=-1 A few things to note, any of which may contribute to the problem but for the life of me I can't figure out how: 1. On Friday we just moved out datacenter to a new location. However we see this problem even internally at the location so I don't believe it is any sort of routing issue (and the problem didn't start until Tuesday). 2. The clock on this webserver was many hours off. On Tuesday (yes, the day the problems started) the clock was synchronized and the timezone correctly set so the machine now has correct time. This seems to be the most probable cause simply because it happened around the same time, but I just can't understand why or how. 3. Yesterday we rebooted the box to see if that would help. It did. We didn't have any more problems at all that day until this morning we see the problems again. Today we recycled just tomcat and that seems to have fixed it as well, though I expect that by tomorrow I will see the problem again. 4. I wouldn't think this could have anything to do with that new Sasser worm, but listing that just in case. The machine is running Linux kernel 2.4.20-8 with httpd-2.0.40-21 and jakarta-tomcat-5.0.18. We are running 4 instances of tomcat on the box, each started with the following JVM options: -Xmn128M -Xmx1024M -Djava.awt.headless=true Nothing having to do with configuration has changed at all in a long time. Here is the relevant configuration sections: # Mod_jk (Tomcat connector) LoadModule jk_module modules/mod_jk.so IfModule mod_jk.c JkWorkersFile /etc/httpd/conf/workers.properties JkLogFile /var/log/httpd/mod_jk.log JkLogLevel info JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat %w %V %T /IfModule ...and later (in a VirtualHost section)... JKMount /myreports balancer JKMount /myreports/* balancer Here is our workers.properties file (comments removed): workers.java_home=/usr/java/j2sdk1.4.2_03 ps=/ worker.list=balancer worker.ajp13_0.port=8090 worker.ajp13_0.host=localhost worker.ajp13_0.type=ajp13 worker.ajp13_0.lbfactor=1 worker.ajp13_1.port=8091 worker.ajp13_1.host=localhost worker.ajp13_1.type=ajp13 worker.ajp13_1.lbfactor=1 worker.ajp13_2.port=8092 worker.ajp13_2.host=localhost worker.ajp13_2.type=ajp13 worker.ajp13_2.lbfactor=1 worker.ajp13_3.port=8093 worker.ajp13_3.host=localhost worker.ajp13_3.type=ajp13 worker.ajp13_3.lbfactor=1 worker.balancer.type=lb worker.balancer.balanced_workers=ajp13_0, ajp13_1, ajp13_2, ajp13_3 worker.balancer.sticky_session=1 Any help would be greatly appreciated! Thanks, -shawn -- Shawn Wilson [EMAIL PROTECTED] Software Developer, ATMReports.com PH: 877-327-0873, FAX: 406-294-5806 smime.p7s Description: S/MIME Cryptographic Signature
RE: mod_jk hangs
You might want to check to make sure you have enough tomcat threads for each apache thread. I usually give tomcat a few more threads than apache just to make sure I do not run out. ---snip !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 minSpareThreads=100 maxSpareThreads=300 protocol=AJP/1.3 / ---snip So you might want to increase min and max spare threads to accomodate more requestes from apache to tomcat via mod_jk. Randall -Original Message- From: Shawn Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 9:50 AM To: [EMAIL PROTECTED] Subject: mod_jk hangs Just yesterday we started running into problems requesting pages on our production website through mod_jk. Previously everything had been working fine for months. Essentially what happens is when you request the page for the first time (doesn't seem to matter what browser you're using) the browser just sits and spins. Then after hitting refresh (Ctrl+R) a couple times it finally comes up. Subsequent visits to the same page continue to work for me in Mozilla but after closing IE and reopening it after a couple more requests it hangs again. In case it helps, the site in question is http://www.atmreports.com. I simply cannot figure out what is going on. I do see many errors in the mod_jk.log, but these had been there before when everything worked fine too: [Wed May 05 09:27:46 2004] [jk_ajp_common.c (1137)]: Error reading reply from tomcat. Tomcat is down or network problems. [Wed May 05 09:27:46 2004] [jk_ajp_common.c (1290)]: ERROR: Receiving from tomcat failed, recoverable operation. err=0 [Wed May 05 09:27:46 2004] [jk_ajp_common.c (1309)]: sending request to tomcat failed in send loop. err=0 [Wed May 05 09:27:46 2004] [jk_ajp_common.c (738)]: ERROR: can't receive the response message from tomcat, network problems or tomcat is down. err=-1 A few things to note, any of which may contribute to the problem but for the life of me I can't figure out how: 1. On Friday we just moved out datacenter to a new location. However we see this problem even internally at the location so I don't believe it is any sort of routing issue (and the problem didn't start until Tuesday). 2. The clock on this webserver was many hours off. On Tuesday (yes, the day the problems started) the clock was synchronized and the timezone correctly set so the machine now has correct time. This seems to be the most probable cause simply because it happened around the same time, but I just can't understand why or how. 3. Yesterday we rebooted the box to see if that would help. It did. We didn't have any more problems at all that day until this morning we see the problems again. Today we recycled just tomcat and that seems to have fixed it as well, though I expect that by tomorrow I will see the problem again. 4. I wouldn't think this could have anything to do with that new Sasser worm, but listing that just in case. The machine is running Linux kernel 2.4.20-8 with httpd-2.0.40-21 and jakarta-tomcat-5.0.18. We are running 4 instances of tomcat on the box, each started with the following JVM options: -Xmn128M -Xmx1024M -Djava.awt.headless=true Nothing having to do with configuration has changed at all in a long time. Here is the relevant configuration sections: # Mod_jk (Tomcat connector) LoadModule jk_module modules/mod_jk.so IfModule mod_jk.c JkWorkersFile /etc/httpd/conf/workers.properties JkLogFile /var/log/httpd/mod_jk.log JkLogLevel info JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat %w %V %T /IfModule ...and later (in a VirtualHost section)... JKMount /myreports balancer JKMount /myreports/* balancer Here is our workers.properties file (comments removed): workers.java_home=/usr/java/j2sdk1.4.2_03 ps=/ worker.list=balancer worker.ajp13_0.port=8090 worker.ajp13_0.host=localhost worker.ajp13_0.type=ajp13 worker.ajp13_0.lbfactor=1 worker.ajp13_1.port=8091 worker.ajp13_1.host=localhost worker.ajp13_1.type=ajp13 worker.ajp13_1.lbfactor=1 worker.ajp13_2.port=8092 worker.ajp13_2.host=localhost worker.ajp13_2.type=ajp13 worker.ajp13_2.lbfactor=1 worker.ajp13_3.port=8093 worker.ajp13_3.host=localhost worker.ajp13_3.type=ajp13 worker.ajp13_3.lbfactor=1 worker.balancer.type=lb worker.balancer.balanced_workers=ajp13_0, ajp13_1, ajp13_2, ajp13_3 worker.balancer.sticky_session=1 Any help would be greatly appreciated! Thanks, -shawn -- Shawn Wilson [EMAIL PROTECTED] Software Developer, ATMReports.com PH: 877-327-0873, FAX: 406-294-5806 - To unsubscribe, e-mail: [EMAIL PROTECTED
Re: mod_jk hangs
I can understand how that could help, is there a different syntax for maxSpareThreads for tomcat4 than tomcat5? I see minProcessors and maxProcessors in my configuration, but nothing about minSpareThreads or maxSpareThreads I'm using tomcat 4.1.30 Daniel Randall Svancara wrote: You might want to check to make sure you have enough tomcat threads for each apache thread. I usually give tomcat a few more threads than apache just to make sure I do not run out. ---snip !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 minSpareThreads=100 maxSpareThreads=300 protocol=AJP/1.3 / ---snip So you might want to increase min and max spare threads to accomodate more requestes from apache to tomcat via mod_jk. Randall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk hangs
Also, do these attributes need to be set on the HttpConnector on 8080 as well as the AJP or Coyote connector on 8009? Daniel Gibby wrote: I can understand how that could help, is there a different syntax for maxSpareThreads for tomcat4 than tomcat5? I see minProcessors and maxProcessors in my configuration, but nothing about minSpareThreads or maxSpareThreads I'm using tomcat 4.1.30 Daniel Randall Svancara wrote: You might want to check to make sure you have enough tomcat threads for each apache thread. I usually give tomcat a few more threads than apache just to make sure I do not run out. ---snip !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 minSpareThreads=100 maxSpareThreads=300 protocol=AJP/1.3 / ---snip So you might want to increase min and max spare threads to accomodate more requestes from apache to tomcat via mod_jk. Randall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: mod_jk hangs
On tomcat 4.1.30 it is minProcessors and maxProcessors. And by the look of our production box, I could stand to increase the size a little bit too. !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8009 minProcessors=75 maxProcessors=300 enableLookups=true redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=0 useURIValidationHack=false protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/ Randall -Original Message- From: Daniel Gibby [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 10:04 AM To: Tomcat Users List Subject: Re: mod_jk hangs Also, do these attributes need to be set on the HttpConnector on 8080 as well as the AJP or Coyote connector on 8009? Daniel Gibby wrote: I can understand how that could help, is there a different syntax for maxSpareThreads for tomcat4 than tomcat5? I see minProcessors and maxProcessors in my configuration, but nothing about minSpareThreads or maxSpareThreads I'm using tomcat 4.1.30 Daniel Randall Svancara wrote: You might want to check to make sure you have enough tomcat threads for each apache thread. I usually give tomcat a few more threads than apache just to make sure I do not run out. ---snip !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 minSpareThreads=100 maxSpareThreads=300 protocol=AJP/1.3 / ---snip So you might want to increase min and max spare threads to accomodate more requestes from apache to tomcat via mod_jk. Randall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk hangs
Okay, here is the section from our server.xml in production: Service name=Catalina Connector port=8080 / !-- This is here for compatibility only, not required -- Connector port=8090 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost jvmRoute=ajp13_0 Logger className=org.apache.catalina.logger.FileLogger / Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=localhost appBase=webapps / /Engine /Service I thought it interesting the comment that this is here for compatibility only, not required. It sounds to me that connector is required if I want AJP/1.3 isn't it? I can't remember if that comment was there or if I (mistakingly) added it. Anyways, I see that I could probably do well to add the minSpareThreads and maxSpareThreads parameters. Any idea where I should look in my httpd.conf file to see what values to set these to? Thanks, -shawn Randall Svancara wrote: You might want to check to make sure you have enough tomcat threads for each apache thread. I usually give tomcat a few more threads than apache just to make sure I do not run out. ---snip !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 minSpareThreads=100 maxSpareThreads=300 protocol=AJP/1.3 / ---snip So you might want to increase min and max spare threads to accomodate more requestes from apache to tomcat via mod_jk. Randall -Original Message- From: Shawn Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 9:50 AM To: [EMAIL PROTECTED] Subject: mod_jk hangs Just yesterday we started running into problems requesting pages on our production website through mod_jk. Previously everything had been working fine for months. Essentially what happens is when you request the page for the first time (doesn't seem to matter what browser you're using) the browser just sits and spins. Then after hitting refresh (Ctrl+R) a couple times it finally comes up. Subsequent visits to the same page continue to work for me in Mozilla but after closing IE and reopening it after a couple more requests it hangs again. In case it helps, the site in question is http://www.atmreports.com. I simply cannot figure out what is going on. I do see many errors in the mod_jk.log, but these had been there before when everything worked fine too: [Wed May 05 09:27:46 2004] [jk_ajp_common.c (1137)]: Error reading reply from tomcat. Tomcat is down or network problems. [Wed May 05 09:27:46 2004] [jk_ajp_common.c (1290)]: ERROR: Receiving from tomcat failed, recoverable operation. err=0 [Wed May 05 09:27:46 2004] [jk_ajp_common.c (1309)]: sending request to tomcat failed in send loop. err=0 [Wed May 05 09:27:46 2004] [jk_ajp_common.c (738)]: ERROR: can't receive the response message from tomcat, network problems or tomcat is down. err=-1 A few things to note, any of which may contribute to the problem but for the life of me I can't figure out how: 1. On Friday we just moved out datacenter to a new location. However we see this problem even internally at the location so I don't believe it is any sort of routing issue (and the problem didn't start until Tuesday). 2. The clock on this webserver was many hours off. On Tuesday (yes, the day the problems started) the clock was synchronized and the timezone correctly set so the machine now has correct time. This seems to be the most probable cause simply because it happened around the same time, but I just can't understand why or how. 3. Yesterday we rebooted the box to see if that would help. It did. We didn't have any more problems at all that day until this morning we see the problems again. Today we recycled just tomcat and that seems to have fixed it as well, though I expect that by tomorrow I will see the problem again. 4. I wouldn't think this could have anything to do with that new Sasser worm, but listing that just in case. The machine is running Linux kernel 2.4.20-8 with httpd-2.0.40-21 and jakarta-tomcat-5.0.18. We are running 4 instances of tomcat on the box, each started with the following JVM options: -Xmn128M -Xmx1024M -Djava.awt.headless=true Nothing having to do with configuration has changed at all in a long time. Here is the relevant configuration sections: # Mod_jk (Tomcat connector) LoadModule jk_module modules/mod_jk.so IfModule mod_jk.c JkWorkersFile /etc/httpd/conf/workers.properties JkLogFile /var/log/httpd/mod_jk.log JkLogLevel info JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat %w %V %T /IfModule ...and later (in a VirtualHost section)... JKMount /myreports balancer JKMount /myreports/* balancer Here is our workers.properties file (comments
RE: mod_jk hangs
Well, that depends on what platform and how apache was compiled. As I understand on windows, apache uses the mpm modules and unix it uses forking or it can use mpm. You need to find the section for you platform and make the ajustments as neccessary. Below is the section where you need to look in your apache configuration file, usually called httpd.conf, but i have seen them named apache.conf (gentoo anyone). But you can see the min and max spare servers/threads listed in each section. Just adjust accordingly. I hope this helps. IfModule prefork.c StartServers 75 MinSpareServers 75 MaxSpareServers 300 MaxClients 300 MaxRequestsPerChild 0 /IfModule # worker MPM # StartServers: initial number of server processes to start # MaxClients: maximum number of simultaneous client connections # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxRequestsPerChild: maximum number of requests a server process serves IfModule worker.c StartServers 75 MaxClients 300 MinSpareThreads 75 MaxSpareThreads 300 ThreadsPerChild 25 MaxRequestsPerChild 0 /IfModule # perchild MPM # NumServers: constant number of server processes # StartThreads: initial number of worker threads in each server process # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # MaxThreadsPerChild: maximum number of worker threads in each server process # MaxRequestsPerChild: maximum number of connections per server process IfModule perchild.c NumServers 75 StartThreads 75 MinSpareThreads 75 MaxSpareThreads 300 MaxThreadsPerChild 20 MaxRequestsPerChild 0 /IfModule # WinNT MPM # ThreadsPerChild: constant number of worker threads in the server process # MaxRequestsPerChild: maximum number of requests a server process serves IfModule mpm_winnt.c ThreadsPerChild 250 MaxRequestsPerChild 0 /IfModule -Original Message- From: Shawn Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 10:21 AM To: Tomcat Users List Subject: Re: mod_jk hangs Okay, here is the section from our server.xml in production: Service name=Catalina Connector port=8080 / !-- This is here for compatibility only, not required -- Connector port=8090 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost jvmRoute=ajp13_0 Logger className=org.apache.catalina.logger.FileLogger / Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=localhost appBase=webapps / /Engine /Service I thought it interesting the comment that this is here for compatibility only, not required. It sounds to me that connector is required if I want AJP/1.3 isn't it? I can't remember if that comment was there or if I (mistakingly) added it. Anyways, I see that I could probably do well to add the minSpareThreads and maxSpareThreads parameters. Any idea where I should look in my httpd.conf file to see what values to set these to? Thanks, -shawn Randall Svancara wrote: You might want to check to make sure you have enough tomcat threads for each apache thread. I usually give tomcat a few more threads than apache just to make sure I do not run out. ---snip !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 minSpareThreads=100 maxSpareThreads=300 protocol=AJP/1.3 / ---snip So you might want to increase min and max spare threads to accomodate more requestes from apache to tomcat via mod_jk. Randall -Original Message- From: Shawn Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 9:50 AM To: [EMAIL PROTECTED] Subject: mod_jk hangs Just yesterday we started running into problems requesting pages on our production website through mod_jk. Previously everything had been working fine for months. Essentially what happens is when you request the page for the first time (doesn't seem to matter what browser you're using) the browser just sits and spins. Then after hitting refresh (Ctrl+R) a couple times it finally comes up. Subsequent visits to the same page continue to work for me in Mozilla but after closing IE and reopening it after a couple more requests it hangs again. In case it helps, the site in question is http://www.atmreports.com. I simply cannot figure out what is going on. I do see many errors in the mod_jk.log, but these had been there before when everything worked fine too: [Wed May 05 09:27:46 2004] [jk_ajp_common.c (1137)]: Error reading reply from tomcat
Re: mod_jk hangs
Looks like the maximum for everyting in my config was 150 so I'll try setting maxSpareThreads for Tomcat to 150 as well. If this is indeed the cause of the problem, any idea why it would just start happening yesterday after months without problem? My only guess is that perhaps we just happened to reach some threshold of traffic yesterday that we never did before. Actually, that may indeed be the case since we usually get a surge of traffic during the beginning of a month. Thanks, -shawn Randall Svancara wrote: Well, that depends on what platform and how apache was compiled. As I understand on windows, apache uses the mpm modules and unix it uses forking or it can use mpm. You need to find the section for you platform and make the ajustments as neccessary. Below is the section where you need to look in your apache configuration file, usually called httpd.conf, but i have seen them named apache.conf (gentoo anyone). But you can see the min and max spare servers/threads listed in each section. Just adjust accordingly. I hope this helps. IfModule prefork.c StartServers 75 MinSpareServers 75 MaxSpareServers 300 MaxClients 300 MaxRequestsPerChild 0 /IfModule # worker MPM # StartServers: initial number of server processes to start # MaxClients: maximum number of simultaneous client connections # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxRequestsPerChild: maximum number of requests a server process serves IfModule worker.c StartServers 75 MaxClients 300 MinSpareThreads 75 MaxSpareThreads 300 ThreadsPerChild 25 MaxRequestsPerChild 0 /IfModule # perchild MPM # NumServers: constant number of server processes # StartThreads: initial number of worker threads in each server process # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # MaxThreadsPerChild: maximum number of worker threads in each server process # MaxRequestsPerChild: maximum number of connections per server process IfModule perchild.c NumServers 75 StartThreads 75 MinSpareThreads 75 MaxSpareThreads 300 MaxThreadsPerChild 20 MaxRequestsPerChild 0 /IfModule # WinNT MPM # ThreadsPerChild: constant number of worker threads in the server process # MaxRequestsPerChild: maximum number of requests a server process serves IfModule mpm_winnt.c ThreadsPerChild 250 MaxRequestsPerChild 0 /IfModule -Original Message- From: Shawn Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 10:21 AM To: Tomcat Users List Subject: Re: mod_jk hangs Okay, here is the section from our server.xml in production: Service name=Catalina Connector port=8080 / !-- This is here for compatibility only, not required -- Connector port=8090 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost jvmRoute=ajp13_0 Logger className=org.apache.catalina.logger.FileLogger / Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=localhost appBase=webapps / /Engine /Service I thought it interesting the comment that this is here for compatibility only, not required. It sounds to me that connector is required if I want AJP/1.3 isn't it? I can't remember if that comment was there or if I (mistakingly) added it. Anyways, I see that I could probably do well to add the minSpareThreads and maxSpareThreads parameters. Any idea where I should look in my httpd.conf file to see what values to set these to? Thanks, -shawn Randall Svancara wrote: You might want to check to make sure you have enough tomcat threads for each apache thread. I usually give tomcat a few more threads than apache just to make sure I do not run out. ---snip !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 minSpareThreads=100 maxSpareThreads=300 protocol=AJP/1.3 / ---snip So you might want to increase min and max spare threads to accomodate more requestes from apache to tomcat via mod_jk. Randall -Original Message- From: Shawn Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 9:50 AM To: [EMAIL PROTECTED] Subject: mod_jk hangs Just yesterday we started running into problems requesting pages on our production website through mod_jk. Previously everything had been working fine for months. Essentially what happens is when you request the page for the first time (doesn't seem to matter what browser you're using) the browser just sits and spins. Then after hitting refresh (Ctrl+R) a couple times it finally comes up
RE: mod_jk hangs
I bet your traffic has increase enough that hitting your limit. I implemented a web app at the beginning of this year and I eventually had to increase maximum for everything as our usage increased. Randall -Original Message- From: Shawn Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 10:46 AM To: Tomcat Users List Subject: Re: mod_jk hangs Looks like the maximum for everyting in my config was 150 so I'll try setting maxSpareThreads for Tomcat to 150 as well. If this is indeed the cause of the problem, any idea why it would just start happening yesterday after months without problem? My only guess is that perhaps we just happened to reach some threshold of traffic yesterday that we never did before. Actually, that may indeed be the case since we usually get a surge of traffic during the beginning of a month. Thanks, -shawn Randall Svancara wrote: Well, that depends on what platform and how apache was compiled. As I understand on windows, apache uses the mpm modules and unix it uses forking or it can use mpm. You need to find the section for you platform and make the ajustments as neccessary. Below is the section where you need to look in your apache configuration file, usually called httpd.conf, but i have seen them named apache.conf (gentoo anyone). But you can see the min and max spare servers/threads listed in each section. Just adjust accordingly. I hope this helps. IfModule prefork.c StartServers 75 MinSpareServers 75 MaxSpareServers 300 MaxClients 300 MaxRequestsPerChild 0 /IfModule # worker MPM # StartServers: initial number of server processes to start # MaxClients: maximum number of simultaneous client connections # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxRequestsPerChild: maximum number of requests a server process serves IfModule worker.c StartServers 75 MaxClients 300 MinSpareThreads 75 MaxSpareThreads 300 ThreadsPerChild 25 MaxRequestsPerChild 0 /IfModule # perchild MPM # NumServers: constant number of server processes # StartThreads: initial number of worker threads in each server process # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # MaxThreadsPerChild: maximum number of worker threads in each server process # MaxRequestsPerChild: maximum number of connections per server process IfModule perchild.c NumServers 75 StartThreads 75 MinSpareThreads 75 MaxSpareThreads 300 MaxThreadsPerChild 20 MaxRequestsPerChild 0 /IfModule # WinNT MPM # ThreadsPerChild: constant number of worker threads in the server process # MaxRequestsPerChild: maximum number of requests a server process serves IfModule mpm_winnt.c ThreadsPerChild 250 MaxRequestsPerChild 0 /IfModule -Original Message- From: Shawn Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 10:21 AM To: Tomcat Users List Subject: Re: mod_jk hangs Okay, here is the section from our server.xml in production: Service name=Catalina Connector port=8080 / !-- This is here for compatibility only, not required -- Connector port=8090 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost jvmRoute=ajp13_0 Logger className=org.apache.catalina.logger.FileLogger / Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=localhost appBase=webapps / /Engine /Service I thought it interesting the comment that this is here for compatibility only, not required. It sounds to me that connector is required if I want AJP/1.3 isn't it? I can't remember if that comment was there or if I (mistakingly) added it. Anyways, I see that I could probably do well to add the minSpareThreads and maxSpareThreads parameters. Any idea where I should look in my httpd.conf file to see what values to set these to? Thanks, -shawn Randall Svancara wrote: You might want to check to make sure you have enough tomcat threads for each apache thread. I usually give tomcat a few more threads than apache just to make sure I do not run out. ---snip !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 minSpareThreads=100 maxSpareThreads=300 protocol=AJP/1.3 / ---snip So you might want to increase min and max spare threads to accomodate more requestes from apache to tomcat via mod_jk. Randall -Original Message- From: Shawn Wilson
RE: mod_jk hangs
Dang, my literacy skilz suck today. Sorry about that everyone. Have a good day. -Original Message- From: Randall Svancara [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 10:49 AM To: Tomcat Users List Subject: RE: mod_jk hangs I bet your traffic has increase enough that hitting your limit. I implemented a web app at the beginning of this year and I eventually had to increase maximum for everything as our usage increased. Randall -Original Message- From: Shawn Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 10:46 AM To: Tomcat Users List Subject: Re: mod_jk hangs Looks like the maximum for everyting in my config was 150 so I'll try setting maxSpareThreads for Tomcat to 150 as well. If this is indeed the cause of the problem, any idea why it would just start happening yesterday after months without problem? My only guess is that perhaps we just happened to reach some threshold of traffic yesterday that we never did before. Actually, that may indeed be the case since we usually get a surge of traffic during the beginning of a month. Thanks, -shawn Randall Svancara wrote: Well, that depends on what platform and how apache was compiled. As I understand on windows, apache uses the mpm modules and unix it uses forking or it can use mpm. You need to find the section for you platform and make the ajustments as neccessary. Below is the section where you need to look in your apache configuration file, usually called httpd.conf, but i have seen them named apache.conf (gentoo anyone). But you can see the min and max spare servers/threads listed in each section. Just adjust accordingly. I hope this helps. IfModule prefork.c StartServers 75 MinSpareServers 75 MaxSpareServers 300 MaxClients 300 MaxRequestsPerChild 0 /IfModule # worker MPM # StartServers: initial number of server processes to start # MaxClients: maximum number of simultaneous client connections # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxRequestsPerChild: maximum number of requests a server process serves IfModule worker.c StartServers 75 MaxClients 300 MinSpareThreads 75 MaxSpareThreads 300 ThreadsPerChild 25 MaxRequestsPerChild 0 /IfModule # perchild MPM # NumServers: constant number of server processes # StartThreads: initial number of worker threads in each server process # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # MaxThreadsPerChild: maximum number of worker threads in each server process # MaxRequestsPerChild: maximum number of connections per server process IfModule perchild.c NumServers 75 StartThreads 75 MinSpareThreads 75 MaxSpareThreads 300 MaxThreadsPerChild 20 MaxRequestsPerChild 0 /IfModule # WinNT MPM # ThreadsPerChild: constant number of worker threads in the server process # MaxRequestsPerChild: maximum number of requests a server process serves IfModule mpm_winnt.c ThreadsPerChild 250 MaxRequestsPerChild 0 /IfModule -Original Message- From: Shawn Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 10:21 AM To: Tomcat Users List Subject: Re: mod_jk hangs Okay, here is the section from our server.xml in production: Service name=Catalina Connector port=8080 / !-- This is here for compatibility only, not required -- Connector port=8090 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost jvmRoute=ajp13_0 Logger className=org.apache.catalina.logger.FileLogger / Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=localhost appBase=webapps / /Engine /Service I thought it interesting the comment that this is here for compatibility only, not required. It sounds to me that connector is required if I want AJP/1.3 isn't it? I can't remember if that comment was there or if I (mistakingly) added it. Anyways, I see that I could probably do well to add the minSpareThreads and maxSpareThreads parameters. Any idea where I should look in my httpd.conf file to see what values to set these to? Thanks, -shawn Randall Svancara wrote: You might want to check to make sure you have enough tomcat threads for each apache thread. I usually give tomcat a few more threads than apache just to make sure I do not run out. ---snip !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 minSpareThreads=100 maxSpareThreads
RE: mod_webapp: redirects to ServerName, mod_jk hangs
Thanks for your response Nick. I tried using mod_jk, but wasn't able to get it working. I built mod_jk.so without errors, and put it into the $APACHE_HOME/libexec folder. I created mod_jk.conf, and workers.properties. Then I included mod_jk.conf in httpd.conf, and Apache started up without errors: [Thu Jan 17 14:52:22 2002] [notice] Apache/1.3.9 (Unix) mod_jk/1.1.0 configured -- resuming normal operations I added a AJP13 connector in $TOMCAT_HOME/conf/server.xml, and Tomcat also started up without errors. But when I made a request through the browser, it just timed out. When I checked the logs, there was a small stacktrace in catalina.log: java.lang.NoSuchMethodError: java.net.Socket: method setKeepAlive(Z)V not found at org.apache.ajp.tomcat4.Ajp13Connector.run(Compiled Code) at java.lang.Thread.run(Thread.java:479) And the mod_jk.log says: [Thu Jan 17 15:08:55 2002] [jk_ajp13.c (403)]: Into ajp13_marshal_into_msgb [Thu Jan 17 15:08:55 2002] [jk_ajp13.c (537)]: ajp13_marshal_into_msgb - Done [Thu Jan 17 15:08:55 2002] [jk_connect.c (108)]: Into jk_open_socket [Thu Jan 17 15:08:55 2002] [jk_connect.c (115)]: jk_open_socket, try to connect socket = 9 [Thu Jan 17 15:08:55 2002] [jk_connect.c (124)]: jk_open_socket, after connect ret = 0 [Thu Jan 17 15:08:55 2002] [jk_connect.c (132)]: jk_open_socket, set TCP_NODELAY to on [Thu Jan 17 15:08:55 2002] [jk_connect.c (140)]: jk_open_socket, return, sd = 9 [Thu Jan 17 15:08:55 2002] [jk_ajp13_worker.c (189)]: In jk_endpoint_t::connect_to_tomcat, connected sd = 9 [Thu Jan 17 15:08:55 2002] [jk_ajp13_worker.c (206)]: sending to ajp13 #337 [Thu Jan 17 15:08:55 2002] [jk_ajp13_worker.c (645)]: send_request 2: request body to send 0 - request body to resend 0 And there it just hangs Has anyone experienced this problem?? Can anyone tell me exactly how to configure server.xml for use with mod_jk ?? My system information is following: Tomcat 4.01 Apache 1.3.9 JDK 1.2 OS: Solaris 7 Thx for your help. -OGG -Original Message- From: Nicholas Ide [mailto:[EMAIL PROTECTED]] Sent: 17. janĂșar 2002 14:33 To: [EMAIL PROTECTED] Subject: Re: mod_webapp: redirects to ServerName Oli, My problem (encodeURL bug) is related. If *all* you care about is getting the hostname corrected and if you're not worried about changing ports, then I believe switching from mod_webapp to mod_jk will solve your problem. It is fairly easy to get mod_jk working under tomcat 3.x -- and then you can copy/edit the configuration files over to your tomcat 4.x configuration and add the connector into servlet.xml -Nick Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Post: mailto:[EMAIL PROTECTED] List-Id: Tomcat Users List tomcat-user.jakarta.apache.org Delivered-To: mailing list [EMAIL PROTECTED] From: Oli Gauti Gudmundsson [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: mod_webapp: redirects to ServerName Date: Thu, 17 Jan 2002 13:45:23 - MIME-Version: 1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi guys. I've installed Tomcat4 with Apache through mod_webapp, and it works. However, I have the following problem: If I point my browser to http://www.mydomain.com http://www.mydomain.com , Apache redirects me to http://123.45.67.89/index.jsp http://123.45.67.89/index.jsp , where 123.45.67.89 is the IP address of the server running the application, and is set as the ServerName in httpd.conf. If I change the ServerName in httpd.conf to www.mydomain.com http://www.mydomain.com , then the opposite happens (that is, if I point the browser to 123.45.67.89 I get redirected to www.mydomain.com/index.jsp http://www.mydomain.com/index.jsp ). Now the strange thing is, that if I type the full path (with the /index.jsp at the end), then no redirection occurs. This is a problem for me because I have multiple domain names pointing to the IP address, and the user is always redirected to the IP address, which is unacceptable. Has anyone experienced this problem, or even better, solved it? Thx for your help. -OGG -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: mod_webapp: redirects to ServerName, mod_jk hangs
Oli, Snippets of my mod_jk configuration are: From server.xml: Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=13084 minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ Be sure the port=TBD value above matches the vlaue in your workers.properties file. From httpd.conf/mod_jk.conf: JkMount /your_webapp_name/servlet/* ajp13 If you crank up the debug levels in server.xml, you should be able to see AJP traffic recorded in the catalina output files. -Nick -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Plz help! at wits end! tomcat/mod_jk hangs when calling itself
I had sent an email about this problem on friday, and had some more info to add. My environment: Solaris 8 jdk 1.3.1, with hotspot enabled tomcat 3.2.2 apache 1.3.19 The problem: I have a servlet that opens a URL connection to the servlet container. So if I call http://blah/blinky, where blinky is my servlet, it is possible under some situations for this servlet to open a URL such as http://blah/lumpy, where lumpy is some other servlet. This is part of a largish site publishing framework I built on top of JServ. Now, things worked great with JServ, but I am having a devil of a time getting this to work in Tomcat. Observations: When the blinky servlet opens a URL to the same tomcat instance, the log entries for mod_jk go as far as making the call to marshal stuff before calling tomcat - as seen by the mod_jk.log entry: [jk_ajp13.c (480)]: ajp13_marshal_into_msgb - Done At this point, nothing happens. I *should* be seeing entries for the jk_open_socket function, but they never appear. What I have tried: - I have disabled the default 8080 listener, thinking it may be interfering. No luck - I changed the cachesize of the ajp12 and ajp13 workers to 8 from the default of 1. No luck - I added the min_spare_threads parameter to the entries for the ajp12 and ajp13 connectors in server.xml No luck - switched between tomcat 3.2.1 and 3.2.2 No luck - upgraded apache to 1.3.19 No luck - Torn my hair out from the roots No luck I am at my wits end. Any help will be gratefully received. TIA, naeem
Re: Plz help! at wits end! tomcat/mod_jk hangs when calling itself
Not sure if this is going to be of _any_ assistance whatsoever, but anyway... I've seen a situation where someone was using the java.net.URL package to open a connection and request a page where the connection was opened but it appears the buffer wasn't being flushed, and the request hence wasn't being transmitted to the destination, hence the appearance of hanging. Have you tried sniffing the traffic between the calling servlet and its target? Again, not sure if this will help, but a suggestion nonetheless. cheers dim On Mon, 25 Jun 2001 11:43, you wrote: I had sent an email about this problem on friday, and had some more info to add. My environment: Solaris 8 jdk 1.3.1, with hotspot enabled tomcat 3.2.2 apache 1.3.19 The problem: I have a servlet that opens a URL connection to the servlet container. So if I call http://blah/blinky, where blinky is my servlet, it is possible under some situations for this servlet to open a URL such as http://blah/lumpy, where lumpy is some other servlet. This is part of a largish site publishing framework I built on top of JServ. Now, things worked great with JServ, but I am having a devil of a time getting this to work in Tomcat. Observations: When the blinky servlet opens a URL to the same tomcat instance, the log entries for mod_jk go as far as making the call to marshal stuff before calling tomcat - as seen by the mod_jk.log entry: [jk_ajp13.c (480)]: ajp13_marshal_into_msgb - Done At this point, nothing happens. I *should* be seeing entries for the jk_open_socket function, but they never appear. What I have tried: - I have disabled the default 8080 listener, thinking it may be interfering. No luck - I changed the cachesize of the ajp12 and ajp13 workers to 8 from the default of 1. No luck - I added the min_spare_threads parameter to the entries for the ajp12 and ajp13 connectors in server.xml No luck - switched between tomcat 3.2.1 and 3.2.2 No luck - upgraded apache to 1.3.19 No luck - Torn my hair out from the roots No luck I am at my wits end. Any help will be gratefully received. TIA, naeem