Error sending end packet

打开页面返回502 bad gateway,后台错误日志:

2011-11-21 18:23:14,276 [] WARN  core.MsgContext - Error sending end packet
java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
        at org.apache.jk.common.ChannelSocket.send(ChannelSocket.java:531)
        at org.apache.jk.common.JkInputStream.endMessage(JkInputStream.java:112)
        at org.apache.jk.core.MsgContext.action(MsgContext.java:293)
        at org.apache.coyote.Response.action(Response.java:182)
        at org.apache.coyote.Response.finish(Response.java:304)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:204)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:662)
2011-11-21 18:23:14,277 [] WARN  common.ChannelSocket - processCallbacks status 2

根据错误信息推测错误应该是mod_jk在send返回数据的时候,连接关掉了。

查了下apache和jboss的配置

apache:

Timeout 30

jboss:

 <Connector port="7011" address="${jboss.bind.address}" backlog="256" maxThreads="250" emptySessionPath="true" enableLookups="false" 
connectionTimeout="600000" disableUploadTimeout="true" protocol="AJP/1.3" URIEncoding="GBK"/>

如果服务器处理请求时间超过30s,则apache会关掉连接,后台处理好之后回写的时候,就报这个错误了。


查了一下该sql的查询时间,居然平均50多s,悲剧阿,优化sql去。


你可能感兴趣的:(apache,sql,优化,jboss,服务器)