春晚小品2013,小白张艾亚,复方金荞麦颗粒
生产环境,突然爆发问题,网络正常,但是报网络不通错误,重启tomcat立刻好使
开始以为是tomcat的问题,调查了很久,后来加上堆栈日志才发现
简单来说,就是1-4分钟之内,使用了大量的http请求,达到了操作系统限制的最大值,所以许多请求处于wait状态,导致程序错误
原代码,httpclient 未关闭
finally { if (is != null) { is.close(); } if (postmethod != null) { postmethod.releaseconnection(); } }
新代码,httpclient正确关闭
finally { if (is != null) { try{ is.close(); }catch(exception e){ } } if(postmethod!=null) postmethod.releaseconnection(); if(httpclient!=null) httpclient.gethttpconnectionmanager().closeidleconnections(0); }
祝开发顺利!
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
浅析我对 String、StringBuilder、StringBuffer 的理解
使用IDEA搭建SSM框架的详细教程(spring + springMVC +MyBatis)
Springboot整合freemarker 404问题解决方案
引入mybatis-plus报 Invalid bound statement错误问题的解决方法
网友评论