Title: Suggestion with cluster module when use "maxConnection" in its worker process · Issue #54882 · nodejs/node · GitHub
Open Graph Title: Suggestion with cluster module when use "maxConnection" in its worker process · Issue #54882 · nodejs/node
X Title: Suggestion with cluster module when use "maxConnection" in its worker process · Issue #54882 · nodejs/node
Description: 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 "maxConnec...
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/nodejs/node/issues/54882
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Suggestion with cluster module when use \"maxConnection\" in its worker process","articleBody":"### What is the problem this feature will solve?\n\nWhen 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**\".\r\n\r\n```javascript\r\nconst cluster = require('cluster');\r\nconst http = require('http');\r\nconst process = require('process');\r\n\r\nif (cluster.isPrimary) {\r\n console.log(`Master ${process.pid} is running.\\n`);\r\n for (let i = 0; i \u003c 1; i++) {\r\n cluster.fork();\r\n }\r\n} else {\r\n const server = http.createServer((req, res) =\u003e {\r\n res.writeHead(200);\r\n res.end('hello world\\n');\r\n });\r\n\r\n server.maxConnections = 0;\r\n\r\n server.listen(8000, () =\u003e {\r\n console.log(`Worker ${process.pid} started`);\r\n });\r\n}\r\n```\n\n### What is the feature you are proposing to solve the problem?\n\nFor example, add An option \"--maxconnections-drop-request\" to the node \"Command-line options\" while on start up.\n\n### What alternatives have you considered?\n\n_No response_","author":{"url":"https://github.com/EchoFUN","@type":"Person","name":"EchoFUN"},"datePublished":"2024-09-11T05:09:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/54882/node/issues/54882"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:61625552-731c-f6a8-0ae1-fac5ae6bf736 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B778:45C3A:ADBDB:EDDBB:6A4D515F |
| html-safe-nonce | 31b039d0a031040773bb9c07278be253d664e47af71c5558149e4b47f78e218e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzc4OjQ1QzNBOkFEQkRCOkVEREJCOjZBNEQ1MTVGIiwidmlzaXRvcl9pZCI6IjI4MTEzMzA0NzI0MTEyMjIzNjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d3dc74146aae64843019c6ad77e18f13899bb8d53546d1a803d9c6060ace1c33 |
| hovercard-subject-tag | issue:2518489689 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/54882/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bc6b77cc2e85c7153460a7848ac86f5507b1ae470a0d8dd353646e3b4ef41c56/nodejs/node/issues/54882 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bc6b77cc2e85c7153460a7848ac86f5507b1ae470a0d8dd353646e3b4ef41c56/nodejs/node/issues/54882 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | EchoFUN |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width