Chinaunix

标题: 烦,动不动就出现Service Temporarily Unavailable [打印本页]

作者: skyone    时间: 2008-06-20 15:18
标题: 烦,动不动就出现Service Temporarily Unavailable
tomcat + apache
动不动就出Service Temporarily Unavailable
各jsp网站都打不开了,php倒是正常的很, 服务器配置应该足够, google了一下, 似乎跟apache的连接并发数有关系, 可是也简单设置了一下测试过, 没搞定, 请教一下, 具体应该配置哪些参数???
作者: 守住每一天    时间: 2008-06-20 17:43
apache 与tomcat 在同一机器?

LZ 多提供点信息。
作者: ipaddr    时间: 2008-06-20 18:15
走啥协议?mod_jk?

看Log。

估计是Tomcat死了,或连接数不够。
作者: skyone    时间: 2008-06-21 00:06
原帖由 守住每一天 于 2008-6-20 17:43 发表
apache 与tomcat 在同一机器?

LZ 多提供点信息。



是的, 同一机器, 但php的站运行正常
作者: skyone    时间: 2008-06-21 00:07
原帖由 ipaddr 于 2008-6-20 18:15 发表
走啥协议?mod_jk?

看Log。

估计是Tomcat死了,或连接数不够。




是的, 是mod_jk , 默认连接数是多少哟?似乎没几个人访问啊, tomcat仍在运行中。。。。。。。。
作者: todayhero    时间: 2008-06-21 01:29
原帖由 skyone 于 2008-6-20 15:18 发表
tomcat + apache
动不动就出Service Temporarily Unavailable
各jsp网站都打不开了,php倒是正常的很, 服务器配置应该足够, google了一下, 似乎跟apache的连接并发数有关系, 可是也简单设置了一下测 ...



1.独立测试一下tomcat是不是正常.方法很简单就是访问8080端口.若是正常,表示tomcat没有问题.

http://Y_R_HOSTNAME FOR Y_R_IP:8080

若是有问题了,那就看一下,日志输出,包括stderr stdout等日志


2.Service Temporarily Unavailable这种情况,
通常是tomcat死掉
作者: china_blues    时间: 2008-06-21 18:39
新手搭车问一下大家,知道tomcat在配置文件里改连接线程数,可是有什么命令能看到当前有多少个线程已经被使用,以在线程不够时调整参数?就像apache的进程可以ps -ef | grep httpd |wc -l 一般,tomcat咋看??
作者: 守住每一天    时间: 2008-06-21 22:27
LZ 可以按6楼说的做一下。

7楼的方法一样。把httpd 改为tomcat 就可以了。
作者: china_blues    时间: 2008-06-22 11:59
谢ls回复
可是我在server.xml里已经设置最小线程为100,可ps -ef 只看到一个tomcat的进程啊
我是想看到底用到了多少线程,合不合实际需求以此来修改参数.
作者: hmglly    时间: 2008-06-23 09:49
原帖由 china_blues 于 2008-6-22 11:59 发表
谢ls回复
可是我在server.xml里已经设置最小线程为100,可ps -ef 只看到一个tomcat的进程啊
我是想看到底用到了多少线程,合不合实际需求以此来修改参数.

你有100个访问的时候,才能出现100,你没有访问的话,出现一个已经不错了
作者: skyone    时间: 2008-06-23 20:35
原帖由 todayhero 于 2008-6-21 01:29 发表



1.独立测试一下tomcat是不是正常.方法很简单就是访问8080端口.若是正常,表示tomcat没有问题.

http://Y_R_HOSTNAME FOR Y_R_IP:8080

若是有问题了,那就看一下,日志输出,包括stderr stdout等日志

...



要烦死了, 看了下, 似乎是tomcat死了, 访问基本的html都访问不了, 一样报这个错误。
请教下如何调试及解决 ????
作者: skyone    时间: 2008-06-23 20:51
原帖由 hmglly 于 2008-6-23 09:49 发表

你有100个访问的时候,才能出现100,你没有访问的话,出现一个已经不错了



在stdout中发现以下错误,不知道tomcat是不是因为这些才出问题

Exception in thread "TP-Processor2" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor7" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor3" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor10" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor12" java.lang.OutOfMemoryError: PermGen space
2008-06-23 20:22:17,222 [com.laoer.bbscs.service.task.SubscibeSendTimerTask]-[INFO] Send Subscibe, subscibeQueue's Num:0
2008-06-23 20:22:17,222 [com.laoer.bbscs.service.task.SubscibeSendTimerTask]-[INFO] Send Subscibe End
Exception in thread "TP-Processor1" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor8" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-8080-1" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor6" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor16" java.lang.OutOfMemoryError: PermGen space
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#4" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor11" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor9" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor5" java.lang.OutOfMemoryError: PermGen space
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#3" java.lang.OutOfMemoryError: PermGen space
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0" java.lang.OutOfMemoryError: PermGen space
2008-06-23 20:27:17,285 [com.laoer.bbscs.service.task.SubscibeSendTimerTask]-[INFO] Send Subscibe, subscibeQueue's Num:0
2008-06-23 20:27:17,285 [com.laoer.bbscs.service.task.SubscibeSendTimerTask]-[INFO] Send Subscibe End
Exception in thread "TP-Processor15" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor14" java.lang.OutOfMemoryError: PermGen space
2008-06-23 20:27:31,722 [com.laoer.bbscs.service.task.LoginErrorClearTimerTask]-[INFO] Start LoginErrorClearTimerTask...
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#6" Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2" java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor13" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor20" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor19" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor18" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-8080-2" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor17" java.lang.OutOfMemoryError: PermGen space
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#7" java.lang.OutOfMemoryError: PermGen space
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#5" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor24" java.lang.OutOfMemoryError: PermGen space
Exception in thread "TP-Processor23" java.lang.OutOfMemoryError: PermGen space
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:28
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.OutOfMemoryError: PermGen space
log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
log4j:WARN Please initialize the log4j system properly.
作者: shjiangdongyu    时间: 2012-09-19 14:04
响应时间timeout设置长点就可以了




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2