Node concurrent request

the company needs to send messages to Wechat official account users. There are about 600000 users. I control on this side of the program to initiate 3000 requests to send Wechat messages, and the next 3000 messages will be launched only after the processing is completed. The request module is used to initiate the request.

but I don"t know why the server is sometimes jammed. If you check through pm2 monit that the active requests reaches more than 10,000, the server will enter a jammed state.

I really don"t understand why I have already controlled 3000 once before. Why did the active requests reach 10,000? I hope all the bosses will not hesitate to solve the doubts.

Dec.14,2021

promise simulation queue


so how do you control it?


you can use a ulimit to check the port range. When the request is actively disconnected, your port will be in close wait state. You can use netstat to see if the request cannot be sent because the port is insufficient

.
Menu