简体   繁体   English

有时 503 服务在同时 API 调用上不可用。 NodeJS 与 mongoDB

[英]Sometimes 503 Service Unavailable on Simultaneous API calls. NodeJS with mongoDB

We are working on a mobile application, Being a mobile developer Im lack of server knowledge.我们正在开发移动应用程序,作为移动开发人员我缺乏服务器知识。

Some custom apis are made to do some longer operations such as retrieving orders of customer from the db and eliminating the invalid records and returning the remaining as response back.一些自定义 api 用于执行一些较长的操作,例如从数据库中检索客户订单并消除无效记录并将剩余的记录作为响应返回。

When the same custom API is called multiple times parallelly i get 503 service unavailable error sometimes.当同时多次调用相同的自定义 API 时,有时会出现 503 服务不可用错误。 But when I call only once at a time the API seems working fine.但是当我一次只调用一次时,API 似乎工作正常。

But some other apis which does simple operations work very well even if they called 100 times simultaneously.但是其他一些执行简单操作的 api 即使同时调用 100 次也能很好地工作。 So i hope there is no problem with server hardware resources.所以我希望服务器硬件资源没有问题。

What can be the issue, Just trying to understand.可能是什么问题,只是想了解。 While I was researching on this issue I came to know these things..当我研究这个问题时,我开始了解这些事情..

Redis, Queue Systems, MongoDB Queue Redis,队列系统,MongoDB 队列

Is this issue is related to the above things or can it be related to the Load balancer, NGINX or it's Just the way how the custom API is written or could it be the server resources?这个问题是与上述事情有关还是与负载均衡器有关,NGINX 或者只是自定义 API 的编写方式还是服务器资源?

I just found similar question but couldn't find any answers.我刚刚发现了类似的问题,但找不到任何答案。

NodeJS app with Apache2 sometimes returns 503 Server Unavailable带有 Apache2 的 NodeJS 应用程序有时会返回 503 Server Unavailable

Please help!!请帮忙!!

Thanks in advance:)提前致谢:)

I checked the log with server guys support, It turns out the problem was returning call back in incorrect place.我检查了服务器人员支持的日志,结果发现问题是在错误的位置回电。

The actual error getting thrown was error callback was already called.抛出的实际错误是已经调用了错误回调。 And the server was restarting.服务器正在重新启动。

We started fixing all the apis one by one and the problem seems went off我们开始一一修复所有的api,问题似乎消失了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM