[英]Apache + Tomcat with mod_jk - Web site hangs
I have a website with apache 1.3(SSL enabled) + mod_jk + tomcat 5.5 on Linux redhad setup. 我在Linux redhad设置上有一个带有apache 1.3(启用了SSL)+ mod_jk + tomcat 5.5的网站。 Just recently i started having a downtime problem with my web site.
就在最近,我的网站开始出现停机问题。 Once a day, i get my web site hang on port 80. But if i access directly through 8080 tomcat responses and web site works fine.
每天一次,我的网站挂在端口80上。但如果我通过8080 tomcat直接访问响应和网站工作正常。 Both 80 and 8080 ports are accessible but apache and tomcat connection with mod_jk is broken.
80和8080端口都可以访问,但与mod_jk的apache和tomcat连接断开。 Only after i restart tomcat, the things get back to normal.
只有在我重新启动tomcat之后,事情才恢复正常。
I just configured apache mod_Jk to log the errors, so i will see if there will be any error on the next hang. 我刚刚配置了apache mod_Jk来记录错误,所以我会看到下次挂起时是否会有任何错误。
apache mod_js conf: apache mod_js conf:
JkShmSize 1000M
apache workers conf: 阿帕奇工人conf:
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=8009
worker.worker1.lbfactor=1
worker.worker1.socket_keepalive=1
worker.worker1.recycle_timeout=180
worker.worker1.sticky_session=False
I checked web application error/warn logs on tomcat, i have some "out of memory" java exceptions. 我检查了tomcat上的web应用程序错误/警告日志,我有一些“内存不足”的java异常。 Can application errors cause this issue ?
应用程序错误会导致此问题吗? Can it be website overload problem or memory leak ?
是网站过载问题还是内存泄漏? Currently
dev/mapper/VolGroup00-LogVol00
has only 4% free space. 目前
dev/mapper/VolGroup00-LogVol00
只有4%的可用空间。 Can it be a cause for the problem ? 这可能是问题的原因吗?
I also got this log entry, it matchs the server hang time: 我也有这个日志条目,它匹配服务器挂起时间:
/var/log/messages: possible SYN flooding on port 8009. Sending cookies
/ var / log / messages:端口8009上可能的SYN泛洪。发送cookie
Update: I just got another down, the mod_jk log gives this: 更新:我刚刚收到另一个,mod_jk日志给出了这个:
[Sun Nov 14 00:57:03 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is$ [Sun Nov 14 00:57:03 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 00:57:08 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is$ [Sun Nov 14 00:57:08 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 00:57:12 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is$ [Sun Nov 14 00:57:12 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 00:57:12 2010] [error] ajp_service::jk_ajp_common.c (1758): Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. w$ [Sun Nov 14 00:57:12 2010] worker1 mydomain.com 50.999342
Looks my website is down on 8009 port. 看起来我的网站在8009端口上。 AJP 1.3 connector serves apache mod_jk on 8009 port.
AJP 1.3连接器在8009端口上提供apache mod_jk。
Any help or advice would be highly appreciated. 任何帮助或建议将受到高度赞赏。
Thanks. 谢谢。
You need more data. 您需要更多数据。
1) setup the server-status handler for apache 1) 为apache设置服务器状态处理程序
2) setup the status worker of mod_jk . 2)设置mod_jk的状态工作者 。 With this you'll then be able to clearly see whether this is a apache to tomcat communication problem.
有了这个,你就可以清楚地看到这是否是tomcat通信问题的apache。
3) when tomcat hangs again do a thread dump to see where the Java processing is currently at. 3)当tomcat再次挂起时,执行线程转储以查看当前Java处理的位置。 Maybe it's waiting for something.
也许它在等待什么。
Edit : In case it's a problem of apache to tomcat problem ([2])
have a look at http://community.jboss.org/wiki/OptimalModjk12Configuration 编辑 :如果是tomcat问题的apache问题
([2])
请看http://community.jboss.org/wiki/OptimalModjk12Configuration
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.