服务器出现broken pipe ,connection reset解决方法

linux下webloigc经常出现broken pipe,socket....connection reset错误.

有有可能是linux的线程机制会产生JVM出错的问题,特别是在连接高峰期间经常出现这样的问题,tomcat在linux下也出现类似情况。

解决办法是在环境变量中设置:_JAVA_SR_SIGNUM=12基本就可以解决。

sun的解释:

--postedby:cooper

BelowisaclippingfromSunonworkingaroundJVMcrashesunderhigh

threadcountsintheJVM1.3forLinux

OnLinux,usealargersignalnumberforhotspotthread

suspension/resumptionhandler.Thesignalnumberbeingusedis

specifiedbyenvironmentvariable_JAVA_SR_SIGNUM.Settingittoa

numberlargerthanSIGSEGV(11)willsolvetheproblem.Agoodnumber

touseis12,whichisSIGUSR2.Usingsignal16toworkaroundthe

problemmighthavepotentialproblems.Soontcsh,"setenv

_JAVA_SR_SIGNUM12"cansolvetheproblem.

上次有人问在连接数据库的时候也出现过connectionreset错误,这有可能是连接没有正常释放(不一定是程序的问题),最好在连接迟中设置无效连接超时的最大值。

相关推荐