首页 > 代码库 > nginx connect() failed (111: Connection refused) while connecting to upstream,请求无响应错误

nginx connect() failed (111: Connection refused) while connecting to upstream,请求无响应错误

2015/01/02 16:01:36 [error] 29002#0: *714153 connect() failed (111: Connection refused) while connecting to upstream, client: 172.16.3.32, server: bizorder.qianbao666.com, request: "POST /api/queryOrder/orderList HTTP/1.1", upstream: "http://172.16.3.32:9300/api/queryOrder/orderList", host: "bizorder.qianbao666.com"

nginx错误日志,实际现象为请求等待响应

经过分析原因是对应服务的tomcat内存设置过小,导致full gc,请求delay引起nginx请求认为超时

 

修复举措:

1)修改nginx对应sever的请求failtimeout,失败时间不宜过短

server 172.16.3.31:9300 max_fails=3 fail_timeout=40s;

2)增加tomcat内存,避免长时间出现full gc

nginx connect() failed (111: Connection refused) while connecting to upstream,请求无响应错误