AWS 504网关超时 - 快速中间件

时间:2016-09-19 22:38:43

标签: node.js amazon-web-services

在AWS上运行我的服务时,我看到504网关超时。根据我的服务日志,看起来早期返回的中间件有一个空白响应,但是对3rdPartyService的请求确实成功了。我无法在本地重现此问题。

以下是详细信息:
MyService< ---> 3rdPartyService
3rdPartyService需要2分钟才能响应,但最终会成功。

MyService在nodeJS上使用express,并使用docker容器部署到AWS上。在AWS ELB超时(设置为5分钟)后,MyService设置为超时。

根据下面的日志片段,请参阅第16行,其中返回状态为200的空白响应。并且第3个PartyService请求在最后一行成功。 MyService日志片段:

    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"status":"PENDING","msg":"","time":"2016-09-19T21:10:09.973Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"msg":"retrying function getLocation in 5000 ms : attempts: 1","time":"2016-09-19T21:10:09.975Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"serviceRequestId":"da7fae85-f624-4338-adbe-4fc8674cd1","msg":"","time":"2016-09-19T21:10:46.037Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"status":"PENDING","msg":"","time":"2016-09-19T21:10:48.354Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"msg":"retrying function getLocation in 5000 ms : attempts: 2","time":"2016-09-19T21:10:48.354Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"serviceRequestId":"da7fae85-f624-4338-adbe-4fc8674cd1","msg":"","time":"2016-09-19T21:10:56.424Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"status":"PENDING","msg":"","time":"2016-09-19T21:11:00.365Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"msg":"retrying function getLocation in 5000 ms : attempts: 3","time":"2016-09-19T21:11:00.365Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"serviceRequestId":"da7fae85-f624-4338-adbe-4fc8674cd1","msg":"","time":"2016-09-19T21:11:07.049Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"status":"PENDING","msg":"","time":"2016-09-19T21:11:08.508Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"msg":"retrying function getLocation in 5000 ms : attempts: 4","time":"2016-09-19T21:11:08.509Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"serviceRequestId":"da7fae85-f624-4338-adbe-4fc8674cd1","msg":"","time":"2016-09-19T21:11:17.422Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"status":"PENDING","msg":"","time":"2016-09-19T21:11:19.128Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"msg":"retrying function getLocation in 5000 ms : attempts: 5","time":"2016-09-19T21:11:19.129Z","v":0}

    {"name":"myservice-api","hostname":"4658d629c774","pid":19,"level":30,"method":"GET","url":"/path/b7446b06-7ac6-40c1-94cd-08fbade4387f/location","status":200,"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36","version":"1.0","ipAddress":"XX.XX.XX.XX","time":129711.250805,"msg":"","v":0}

    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"serviceRequestId":"da7fae85-f624-4338-adbe-4fc8674cd1","msg":"","time":"2016-09-19T21:11:26.294Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"status":"PENDING","msg":"","time":"2016-09-19T21:11:27.995Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"msg":"retrying function getLocation in 5000 ms : attempts: 6","time":"2016-09-19T21:11:27.996Z","v":0}
    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"serviceRequestId":"da7fae85-f624-4338-adbe-4fc8674cd1","msg":"","time":"2016-09-19T21:11:36.641Z","v":0}

    {"name":"adapters/demo_adapter","hostname":"4658d629c774","pid":19,"level":30,"coord":{"lat":37.39948777777778,"lon":-102.045195},"status":"SUCCESS","msg":"","time":"2016-09-19T21:11:39.416Z","v":0}

0 个答案:

没有答案