覆盖环境:
日本东京预发环境-阿里云ecs
日本山田线上环境-日本server
架构:预发环境和线上环境同架构
出现问题
1)参考nginx error日志
2020/08/21 10:29:24 [error] 12668#0: *248176 upstream timed out (110: Connection timed out) while connecting to upstream, client: 47.74.13.112, server: , request: "POST /zk/translate/getTanslateForWebByType?Language=cn HTTP/1.1", upstream: "http://172.27.97.141:9999/translate/getTanslateForWebByType?Language=cn", host: "47.91.29.12", referrer: "http://47.91.29.12/"
2)访问http://xxx.com F12
- 定位问题
参考日志
2020/08/21 10:55:59 [error] 30841#0: *249984 upstream timed out (110: Connection timed out) while connecting to upstream, client: 47.74.13.112, server: , request: "POST /zk/translate/getTanslateForWebByType?Language=cn HTTP/1.1", upstream: "http://172.27.97.141:9999/translate/getTanslateForWebByType?Language=cn", host: "47.91.29.12", referrer: "http://47.91.29.12/"
本次使用负载均衡轮询算法 可以看出第一次请求到了前端的LB机器上导致504 超时 第二次请求打到了后端的backup服务器上 状态码200那么这个加载慢的算是找到哪台机器有问题了,也可以看下nginx日志.