I have a node (express) app running on AWS that is randomly returning 504 (GATEWAY_TIMEOUT) without reaching the actual timeout (60 sec) threshold:
You can see that the requests following the failed ones take more time than the "timed out" ones...
On my express app I have:
server.keepAliveTimeout = 65000;
Any ideas?
EDIT: Adding ELB Logs:
2019-01-18T09:06:56.554353Z a38e67823174c11e9a984022fe7c311b 189.58.239.206:51399 - -1 -1 -1 504 0 0 0 "GET <app_endpoint> HTTP/1.1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2
2019-01-18T09:06:56.564478Z a38e67823174c11e9a984022fe7c311b 189.58.239.206:51400 - -1 -1 -1 504 0 0 0 "GET <app_endpoint> HTTP/1.1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2
2019-01-18T09:06:56.580591Z a38e67823174c11e9a984022fe7c311b 189.58.239.206:51401 - -1 -1 -1 504 0 0 0 "GET <app_endpoint> HTTP/1.1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2
2019-01-18T09:06:56.602049Z a38e67823174c11e9a984022fe7c311b 189.58.239.206:51398 - -1 -1 -1 504 0 0 0 "GET <app_endpoint> HTTP/1.1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2