【在线等】Tomcat问题高手或者版主或遇到内似问题的大哥大姐来看我这个问题

我们服务器的配置情况如下
P4 3.6
内存 1G
硬盘 SCSI 140 G 分区情况 /boot(500M) /SWAP (2048M) /(剩余全部磁盘空间)
服务器是新的HP全新配置
服务器的WEB配置情况:红旗LINUX5.0服务亚洲版+TOMCAT5.5.17+MYSQL5.0.22+JDK1.5.0.6
TOMCAT和 MYSQL以及JD的安配置过程我就不说了

现在的问题是:开发组十几个人点击,频繁刷新(遨游浏览器有个自动刷新的功能^_^,我们每台机器开了网站上15个左右窗口,设置成每隔10秒自动刷新),结果不到十分钟就TOMCAT就宕机了
终端显示错误如下:

严重:All threads (150) are currently busy, waiting. Increase maxThreads (150) or check the servlet status


程序是用的hibernate + spring

Connector port="80"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />

我试图把maxThreads改为999

Connector port="80"
maxThreads="999" minSpareThreads="25" maxSpareThreads="999"
enableLookups="false" redirectPort="8443" acceptCount="999"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />

再测试 ,十多分钟后问题依旧 报错如下:
严重:All threads (999) are currently busy, waiting. Increase maxThreads (999) or check the servlet status
这个已经最大了 web server允许的最大连接数还受制于操作系统的内核参数设置,通常Windows是2000个左右,Linux是1000个左右。也就是说maxThreads最大连接数,不能高于一千。

并且我在catalina.sh中配置了JAVA_OPTS='-Xms256m -Xmx512m'最大内存


MYSQL的配置文件 /etc/my.cnf

# The following options will be passed to all MySQL clients
[client]
password = your_password
port = 3306
socket = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 384M
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
back_log = 500
max_connections = 1024
default-character-set = gb2312
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
safe-updates

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout


问题 :大家看是什么问题,是TOMCAT的配置问题,还是MYSQL的问题
还是程序的问题,我们好象是用的tomcat自己带的数据库连接池,没有用到
MYSQL官方网站上的连接池的jar文件,不知道是不是这个的问题。


这种问题你不仔细查,乱猜估计很难。
1)你应该先查是不是数据库有死锁。
2)通过程序打出日志,来判断是否有引起问题的异常或其他蛛丝马迹。