TOMCAT进程假死问题
我公司现有一台WEB服务器,架构是:linux+nginx+tomcat+mysql
具体软件版本:
linux:RHEL5.4
NGINX:nginx-0.8.54
tomcat:apache-tomcat-6.0.18
mysql:5.0
目前的主要问题是,当tomcat的本地连接数达到100时,就无法通过互联网络访问WEB SERVER。当把TOMCAT重启后,服务器又恢复正常。
通过netstat -an如下:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:721 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:37149 127.0.0.1:8080 FIN_WAIT2
tcp 0 0 10.0.0.3:80 192.168.3.164:2175 ESTABLISHED
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN
tcp 0 0 :::8009 :::* LISTEN
tcp 0 0 :::8080 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38686 CLOSE_WAIT
tcp 446 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:37149 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38685 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:36381 CLOSE_WAIT
tcp 325 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:37148 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38684 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38683 CLOSE_WAIT
tcp 446 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:37147 CLOSE_WAIT
tcp 321 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58899 CLOSE_WAIT
tcp 357 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58898 CLOSE_WAIT
tcp 388 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58897 CLOSE_WAIT
tcp 395 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58896 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57870 CLOSE_WAIT
tcp 232 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57869 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57868 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57867 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57866 CLOSE_WAIT
tcp 334 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57865 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57864 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57863 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57862 CLOSE_WAIT
tcp 616 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57861 CLOSE_WAIT
tcp 357 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57089 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:34048 CLOSE_WAIT
tcp 357 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57088 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:60478 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:60477 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:60476 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:60475 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39732 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39730 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39729 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39728 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38693 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38692 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38691 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38690 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38689 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38688 CLOSE_WAIT
tcp 713 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58207 CLOSE_WAIT
tcp 711 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58206 CLOSE_WAIT
tcp 717 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58205 CLOSE_WAIT
tcp 717 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58204 CLOSE_WAIT
tcp 322 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58203 CLOSE_WAIT
tcp 715 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58202 CLOSE_WAIT
tcp 715 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58201 CLOSE_WAIT
tcp 715 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58200 CLOSE_WAIT
tcp 713 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58199 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:56150 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58198 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:50261 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58195 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:50258 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58194 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58193 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39504 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:32837 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:47992 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43935 CLOSE_WAIT
tcp 232 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43934 CLOSE_WAIT
tcp 315 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43933 CLOSE_WAIT
tcp 315 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43932 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43931 CLOSE_WAIT
tcp 310 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43930 CLOSE_WAIT
tcp 0 52 ::ffff:10.0.0.3:22 ::ffff:192.168.3.1:1853 ESTABLISHED
tcp 344 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39808 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53939 CLOSE_WAIT
tcp 403 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53938 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53937 CLOSE_WAIT
tcp 289 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53936 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53935 CLOSE_WAIT
tcp 403 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53934 CLOSE_WAIT
tcp 403 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53933 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:40620 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53932 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:40619 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53931 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:40618 CLOSE_WAIT
tcp 232 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53930 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:40617 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43941 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43940 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43939 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43938 CLOSE_WAIT
tcp 232 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43937 CLOSE_WAIT
tcp 463 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43936 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:44254 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:44253 CLOSE_WAIT
tcp 278 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:46295 CLOSE_WAIT
tcp 325 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:46294 CLOSE_WAIT
tcp 309 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:46293 CLOSE_WAIT
tcp 287 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57087 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:37631 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:34047 CLOSE_WAIT
tcp 446 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57086 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:37630 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:34046 CLOSE_WAIT
tcp 446 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57085 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38886 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38885 CLOSE_WAIT
udp 0 0 0.0.0.0:715 0.0.0.0:*
udp 0 0 0.0.0.0:718 0.0.0.0:*
udp 0 0 0.0.0.0:5353 0.0.0.0:*
udp 0 0 0.0.0.0:55915 0.0.0.0:*
udp 0 0 0.0.0.0:111 0.0.0.0:*
udp 0 0 :::47661 :::*
udp 0 0 :::5353 :::*
此时,内存、CPU利用率都不是很高。我搞不懂这是怎么回事,请高人指点一下。
其次我想了办法,写一个SHELL脚本,当进程达到100时,自动重新启动tomcat,但是由于自身SHELL水平有限,所以,请大家帮助我完成这个脚本,脚本如下:
#!/bin/bash
tmp=`netstat -an|grep 127.0.0.1:8080|grep CLOSE_WAIT |wc -l`
tmp=$tmp>100
if [ 0 ]
then
/usr/local/tomcat/bin/shutdown.sh
sleep 5
/usr/local/tomcat/bin/startup.sh
else
echo "do not need to restart the tomcat programe" >> tomcat_monitor_log.log
fi
这个脚本的执行结果总与我的实际想法总是不一致。这高人帮我看一点问题出在哪里了?
先谢谢了!
具体软件版本:
linux:RHEL5.4
NGINX:nginx-0.8.54
tomcat:apache-tomcat-6.0.18
mysql:5.0
目前的主要问题是,当tomcat的本地连接数达到100时,就无法通过互联网络访问WEB SERVER。当把TOMCAT重启后,服务器又恢复正常。
通过netstat -an如下:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:721 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:37149 127.0.0.1:8080 FIN_WAIT2
tcp 0 0 10.0.0.3:80 192.168.3.164:2175 ESTABLISHED
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN
tcp 0 0 :::8009 :::* LISTEN
tcp 0 0 :::8080 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38686 CLOSE_WAIT
tcp 446 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:37149 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38685 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:36381 CLOSE_WAIT
tcp 325 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:37148 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38684 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38683 CLOSE_WAIT
tcp 446 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:37147 CLOSE_WAIT
tcp 321 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58899 CLOSE_WAIT
tcp 357 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58898 CLOSE_WAIT
tcp 388 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58897 CLOSE_WAIT
tcp 395 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58896 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57870 CLOSE_WAIT
tcp 232 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57869 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57868 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57867 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57866 CLOSE_WAIT
tcp 334 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57865 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57864 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57863 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57862 CLOSE_WAIT
tcp 616 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57861 CLOSE_WAIT
tcp 357 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57089 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:34048 CLOSE_WAIT
tcp 357 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57088 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:60478 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:60477 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:60476 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:60475 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39732 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39730 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39729 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39728 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38693 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38692 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38691 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38690 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38689 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38688 CLOSE_WAIT
tcp 713 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58207 CLOSE_WAIT
tcp 711 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58206 CLOSE_WAIT
tcp 717 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58205 CLOSE_WAIT
tcp 717 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58204 CLOSE_WAIT
tcp 322 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58203 CLOSE_WAIT
tcp 715 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58202 CLOSE_WAIT
tcp 715 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58201 CLOSE_WAIT
tcp 715 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58200 CLOSE_WAIT
tcp 713 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58199 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:56150 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58198 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:50261 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58195 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:50258 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58194 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:58193 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39504 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:32837 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:47992 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43935 CLOSE_WAIT
tcp 232 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43934 CLOSE_WAIT
tcp 315 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43933 CLOSE_WAIT
tcp 315 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43932 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43931 CLOSE_WAIT
tcp 310 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43930 CLOSE_WAIT
tcp 0 52 ::ffff:10.0.0.3:22 ::ffff:192.168.3.1:1853 ESTABLISHED
tcp 344 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:39808 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53939 CLOSE_WAIT
tcp 403 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53938 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53937 CLOSE_WAIT
tcp 289 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53936 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53935 CLOSE_WAIT
tcp 403 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53934 CLOSE_WAIT
tcp 403 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53933 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:40620 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53932 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:40619 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53931 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:40618 CLOSE_WAIT
tcp 232 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:53930 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:40617 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43941 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43940 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43939 CLOSE_WAIT
tcp 288 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43938 CLOSE_WAIT
tcp 232 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43937 CLOSE_WAIT
tcp 463 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:43936 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:44254 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:44253 CLOSE_WAIT
tcp 278 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:46295 CLOSE_WAIT
tcp 325 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:46294 CLOSE_WAIT
tcp 309 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:46293 CLOSE_WAIT
tcp 287 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57087 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:37631 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:34047 CLOSE_WAIT
tcp 446 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57086 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:37630 CLOSE_WAIT
tcp 1 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:34046 CLOSE_WAIT
tcp 446 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:57085 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38886 CLOSE_WAIT
tcp 393 0 ::ffff:127.0.0.1:8080 ::ffff:127.0.0.1:38885 CLOSE_WAIT
udp 0 0 0.0.0.0:715 0.0.0.0:*
udp 0 0 0.0.0.0:718 0.0.0.0:*
udp 0 0 0.0.0.0:5353 0.0.0.0:*
udp 0 0 0.0.0.0:55915 0.0.0.0:*
udp 0 0 0.0.0.0:111 0.0.0.0:*
udp 0 0 :::47661 :::*
udp 0 0 :::5353 :::*
此时,内存、CPU利用率都不是很高。我搞不懂这是怎么回事,请高人指点一下。
其次我想了办法,写一个SHELL脚本,当进程达到100时,自动重新启动tomcat,但是由于自身SHELL水平有限,所以,请大家帮助我完成这个脚本,脚本如下:
#!/bin/bash
tmp=`netstat -an|grep 127.0.0.1:8080|grep CLOSE_WAIT |wc -l`
tmp=$tmp>100
if [ 0 ]
then
/usr/local/tomcat/bin/shutdown.sh
sleep 5
/usr/local/tomcat/bin/startup.sh
else
echo "do not need to restart the tomcat programe" >> tomcat_monitor_log.log
fi
这个脚本的执行结果总与我的实际想法总是不一致。这高人帮我看一点问题出在哪里了?
先谢谢了!
作者: linxor 发布时间: 2011-02-25
请高人指点,非常感谢!
作者: linxor 发布时间: 2011-02-25