Nodejs上的504错误在所有端点上随机随机API服务器
我们有帆JS作为API服务器,间歇性地面对504上游时机,该问题是在nginx上进行的,直到NGINX从那里抛出上游超时,应用程序服务器上没有日志,并且它正在发生在所有的情况下,并且在所有情况下都在发生。 API间歇性地并非一直以来,服务器上的流量非常低,即每分钟5-10个请求,并且没有进行大量计算,因此不确定如何调试此问题。这是一个非常随机的问题。另外,应用程序日志上没有服务器重新启动或任何其他错误。在PM2上运行良好。我们正在使用AWS EC2实例。当前超时为60秒,但我们的API都不超过500毫秒。我们正在使用节点6.6版本,因为它是一个传统的整体应用程序,因此由于多个依赖项而无法升级它,而没有单个所有者。并且请求通过负载平衡器到NGINX,但一段时间没有到达应用程序服务器。同样,实例大小在CPU方面也很大,并且存储器和流量极低。这是一个非常随机的行为,不是API的特定行为。有时,这可能发生在10个中的1个,有时5个请求中有2个可以通过网关超时问题。
NGINX中的一些日志低于
[错误] 31688#31688: *38998779连接()失败(110:连接时,timeed of Out)在连接到上游,client 10.xxx
2022/04/22 2022/22 16:36:37 [错误] 31690#31690: *38998991 connect()失败(110:连接时间),连接到上游,客户端:< server_ip>,server:< dns_url>
我尝试了几乎所有的stackoverflow中的所有事情,但没有任何帮助,所以请帮助我找到根本原因,以便我可以减轻问题
we have sails js as an API server and intermittently we are facing 504 upstream timed out the issue, the call was going till Nginx from there its throwing upstream timeout, there is no log coming on the application server, and it is happening across all the APIs intermittently not all the time, and the traffic on server is very low i.e. 5-10 requests per minute and there is no heavy computation going on, so not sure how can I debug this issue. this is a very random issue. also, there are No server restarts or any other errors on application logs. it's running fine on PM2. we are using an AWS EC2 instance. current timeout is 60 seconds but none of our APIs takes more than 500 milliseconds. we are using the node 6.6 version as it is a legacy monolith app so can not upgrade it due to multiple dependencies and no single owner. and requests are passing through the load balancer to NGINX but some time does not reach the application server. also, the instance size is quite bigger in terms of CPU and memory and traffic is extremely low. this is a very random behavior not specific to API. sometimes it can happen 1 out of 10 sometimes 2 out of 5 requests can through a gateway timeout issue.
some of the logs from Nginx are below-
[error] 31688#31688: *38998779 connect() failed (110: Connection timed out) while connecting to upstream, client 10.X.X.X
2022/04/22 16:36:37 [error] 31690#31690: *38998991 connect() failed (110: Connection timed out) while connecting to upstream, client: <server_ip>, server: <DNS_URL>
guys I have tried almost all the things from StackOverflow but nothing helping me, so please help me to find the root cause so I can mitigate the issue
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论