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

Make # of connections accepted per event loop cycle configurable, and raise the default #3186

Merged
merged 1 commit into from May 4, 2024

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented May 4, 2024

These changes are now available in 4.96.0

As per @weissi's suggestion in this forums post, we raise the default maximum number of connections accepted per cycle of the server's event loop from 4 to 256, and the value is now user-configurable.

There are no new tests for this because I'm not sure if there's a way to measure the effect of changing this value that doesn't involve nondeterministic timing measurements.

Also takes the opportunity/excuse to add the missing customCertificateVerifyCallback parameter to the initializers of HTTPServer.Configuration.

@gwynne gwynne added enhancement New feature or request semver-minor Contains new API labels May 4, 2024
@gwynne gwynne requested review from 0xTim, MahdiBM and ptoffy May 4, 2024 11:51
Copy link
Contributor

@MahdiBM MahdiBM left a comment

Choose a reason for hiding this comment

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

Looks good to me. Reminded me of TCP congestion control, but that's per-connection so not exactly the same as this.

Sources/Vapor/HTTP/Server/HTTPServer.swift Outdated Show resolved Hide resolved
@MahdiBM
Copy link
Contributor

MahdiBM commented May 4, 2024

I'd wait for @0xTim too, since he works more with these lower-level stuff.

@gwynne
Copy link
Member Author

gwynne commented May 4, 2024

I'd wait for @0xTim too, since he works more with these lower-level stuff.

What, you think I'd merge this on your say-so alone? 😂😉

@gwynne gwynne force-pushed the configurable-accept-quantum branch from 7611eeb to caf7bc5 Compare May 4, 2024 12:26
@MahdiBM
Copy link
Contributor

MahdiBM commented May 4, 2024

@gwynne 🫠 😂 of course you would, I know you count every second before you can hit the merge buttons.

@gwynne gwynne force-pushed the configurable-accept-quantum branch from caf7bc5 to 67311b7 Compare May 4, 2024 13:02
@gwynne gwynne force-pushed the configurable-accept-quantum branch from 67311b7 to 22afd1d Compare May 4, 2024 13:59
Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

LGTM!

@gwynne gwynne merged commit af86ea4 into main May 4, 2024
15 of 16 checks passed
@gwynne gwynne deleted the configurable-accept-quantum branch May 4, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request semver-minor Contains new API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants