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

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea1ee6-1b91.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea1ee6-1b91.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?