- 论坛徽章:
- 0
|
我的机器dell2850,双3.2Gcpu,2G内存,RHEL AS4.0。使用tomcat遇到这样的问题,server.xml中配置连接器如下:
<Connector acceptCount="100" connectionTimeout="20000" enablelookups="false" disableUploadTimeout="true" port="80" redirectPort="8443" maxSpareThreads="150" maxThreads="200" minSpareThreads="100">
</Connector>
那么很快,连接就会把所有的线程都占满,catalina.out里看到:
2006-5-22 18:48:07 org.apache.tomcat.util.threads.ThreadPool logFull
严重: All threads (200) are currently busy, waiting. Increase maxThreads (200) or check the servlet status
上述配置在windows上的跑的非常正常。于是调整连接和线程数目:
<Connector acceptCount="2000" connectionTimeout="20000" enablelookups="false" disableUploadTimeout="true" port="80" redirectPort="8443" maxSpareThreads="2000" maxThreads="5000" minSpareThreads="1500">
</Connector>
改过之后,连接和线程够用了,可是内存很快就又溢出了,还是ctalina.out里的日志:
严重: Caught exception (java.lang.OutOfMemoryError: unable to create new native thread) executing org.apache.tomcat.util.net.TcpWorkerThread@da6d09, terminating thread
我分配给java用的内存空间是1个G,tomcat处理web的能力不强,但是同样的访问量,windows系统上可以撑得住,换了Linux就出状况了。提供服务的jsp程序没有改动过,直接从win平台上拿过来用了。百思不得解,请教各位高人,这究竟怎么个原因?有类似经验的朋友,请多多指点!多谢了!
[ 本帖最后由 HonestQiao 于 2006-6-7 22:03 编辑 ] |
|