Skip to content
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

feat: limit the number of connections open in Node.js #271

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

judofyr
Copy link
Contributor

@judofyr judofyr commented Jul 31, 2023

Enable keep-alive, and in addition limit the number of sockets that can be opened. This avoids opening too many connections to the server if someone tries to execute a bunch of requests in parallel. It's recommended to have a concurrency limit at a "higher limit" (i.e. you shouldn't actually execute hundreds of requests in parallel), and this is mainly to minimize the impact for the network and server.

We're currently matching the same defaults as browsers: https://stackoverflow.com/questions/26003756/is-there-a-limit-practical-or-otherwise-to-the-number-of-web-sockets-a-page-op

@judofyr judofyr requested a review from stipsan July 31, 2023 08:05
@judofyr judofyr self-assigned this Jul 31, 2023
@stipsan stipsan requested a review from rexxars August 1, 2023 14:58
Copy link
Member

@stipsan stipsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Member

@rexxars rexxars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grazie!

@stipsan stipsan merged commit 7d3d537 into main Aug 2, 2023
13 checks passed
@stipsan stipsan deleted the node-agent-defaults branch August 2, 2023 02:26
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants