-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion with cluster module when use "maxConnection" in its worker process #54882
Comments
The above sample code is used to better demonstrating this issue, it will cause the request to fail to return, and the CPU will run to the usage of 50%+. |
I think it makes sense. |
And on the documentation, it says "It is not recommended to use this option once a socket has been sent to a child with child_process.fork()." So, I can think of it as not recommended to use this API in cluster mode ? Is anyone have more detail information about it ? Thanks. It may be useful while the traffic is much heavy. |
I think It is not recommended to use this option in chld_process module. If process A receives a socket, then process A's But I think it is ok if you close the socket of process A after sending successfully because the |
PR-URL: #54927 Refs: #54882 Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #54927 Refs: #54882 Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#54927 Refs: nodejs#54882 Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#54927 Refs: nodejs#54882 Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #54927 Refs: #54882 Reviewed-By: Matteo Collina <[email protected]>
What is the problem this feature will solve?
When the node service is under a very high load, multiple connections are processed at the same time in one worker ( we use the cluster module currently in our project ). We set the "maxConnections" to limit the connections of the worker. But we found that if a new request reach the limit of the "maxConnections", the request will retry on other workers. I think can we have an option, if a new request reach the limit, we can just drop the request instead of retrying the request on other workers ? Because as the system is under a very high load, the other workers may also be very busy at this moment. Here is a example on "v22.7.0".
What is the feature you are proposing to solve the problem?
For example, add An option "--maxconnections-drop-request" to the node "Command-line options" while on start up.
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: