请求:POST https://xxx.com/xx/xx
某次并发测试,在单次请求或者少量并发时正常,但在并发量大的时候却出现了问题
响应:Response code: Non HTTP response code: javax.net.ssl.SSLHandshakeException
Response message: Non HTTP response message: Remote host closed connection during handshake
后来由IT调整环境解决,具体怎么解决未说清楚(尝试了很多方法,最终it也不能确认是怎么解决的...)
响应:Response code: Non HTTP response code: java.net.SocketException
Response message: Non HTTP response message: Connection reset
响应:Response code: Non HTTP response code: java.net.SocketException
Response message: Non HTTP response message: Socket closed
服务端断开连接,但并没有通知客户端,导致下次请求该服务时httpclient继续使用该连接导致报错。
在JMeter下,发送http 请求时,默认选择了use keepAlive(Keep-Alive通俗地讲,就是所谓的持久连接,对于http这种大量的短连接的服务来说,开启持久连接的好处可节省大量的TCP连接过程的开销,据apache的官方文档称对包含大量图片的HTML文档造成的延时起到50%的加速作用),这个是连接协议,JMeter坑就在这里,默认勾选了这个(如果不勾选的话,也不会保存),但其配置JMeter.properties中的时间设置默认却是注销的,不会等待,一旦连接空闲,则立即断开了,导致压测中出现了事务失败的情形。
解决:修改httpclient4.idletimeout=<time in ms> 设置成自己觉得合理的时间,一般可设置成10-60s(表示连接空闲10s后才会断开),注意这边单位是ms。修改完成后再次压测,错误不再有了。
响应:Response code: 504
Response message: Gateway Time-out
(Nginx的nginx.conf中参数配置问题)
响应:Response code: Non HTTP response code: org.apache.http.NoHttpResponseException
Response message: Non HTTP response message: img.xxx.com:443 failed to respond
官网解释
org.apache.commons.httpclient.NoHttpResponseException:
In some circumstances, usually when under heavy load, the web server may be able to receive requests but unable to process them.A lack of sufficient resources like worker threads is a good example. This may cause the server to drop the connection to the client without giving any response. HttpClient throws NoHttpResponseException when it encounters such a condition. In most cases it is safe to retry a method that failed with NoHttpResponseException.