nginx负载均衡页面不定时出现520错误

wanjia19 2015-12-02 03:28:12
阿里云的机器,以前偶尔会出现502,最近突然频繁了,每天四五次,每次都重启其中一个机器的memcache和网站程序才行,
nginx的err日志:
2015/12/02 10:51:34 [error] 1572#0: *1051463 no live upstreams while connecting to upstream, client: xx.xxx.xxx.xx, server: localhost, request: "HEAD / HTTP/1.0", upstream: "http://app/test/testIndex.action"
2015/12/02 10:51:34 [error] 1572#0: *1051464 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xxx.xxx.xxx, server: localhost, request: "HEAD / HTTP/1.0", upstream: "http://xx.xxx.xxx.xx:8080/test/testIndex.action"
2015/12/02 10:51:34 [error] 1572#0: *1051464 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xxx.xxx.xxx, server: localhost, request: "HEAD / HTTP/1.0", upstream: "http://127.0.0.1:8080/test/testIndex.action"
java写的网站,有两台服务器,linux系统,resin 4.0做web容器,有时登录网站会提示502,这期间直接通过IP访问或者IP加端口都不能打开页面,但是在后台看应用日志发现网站程序还在正常跑,对nginx和resin都不怎么熟,请教下出现这种情况大概问题是在哪里,nginx的问题还是regin的问题。
程序还用了Memcached,每次出现这种情况我重启一台机器的memcache和应用就正常了,只是最近突然频繁了。
页面提示信息:
502 Bad Gateway
The proxy server received an invalid response from an upstream server. Sorry for the inconvenience.
Please report this message and include the following information to us.
Thank you very much!
特疑惑为什么会不定时的出现502,如果是配置内容问题应该是一直出现错误,如果是内存什么的问题,有时候刚重启完马上就出现这种情况了。想不清问题会在哪。
...全文
2040 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
wanjia19 2017-02-12
  • 打赏
  • 举报
回复
问题已经查到了。 是阿里云的健康检查机制和本地系统性能造成的。
akin_zhou 2016-01-05
  • 打赏
  • 举报
回复
看日志提示这应该是后端服务器出现问题了,检查一下后端服务器的日志吧
李睿_Lee 2015-12-13
  • 打赏
  • 举报
回复
一般有两种可能,一种是请求后端超时,然后Nginx断开连接,另一种就是后端资源不够,导致无法连接上。

25,985

社区成员

发帖
与我相关
我的任务
社区描述
高性能WEB开发
社区管理员
  • 高性能WEB开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧