Skip to content

Pool HttpSys request buffers #17314

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

Merged
merged 8 commits into from
Nov 22, 2019
Merged

Pool HttpSys request buffers #17314

merged 8 commits into from
Nov 22, 2019

Conversation

Tratcher
Copy link
Member

@Tratcher Tratcher commented Nov 22, 2019

#5849 Finally addressing this perf issue since we have bigger customers moving to core that want Http.Sys. Switching to Kestrel's slab memory pool solves two problems:
A) these 4kb buffers get re-used, cutting GC pressure.
B) the slabs are in the LoH so pinning them doesn't cause fragmentation.

@sebastienros

Scenario: 100k requests over 500 parallel connections.
TLDR: Cut request buffer allocations from 425MB to 9MB

Before:
image
After using the slab memory pool:
image
I also tried to use the shared ArrayPool but it was worse here:
image

@Tratcher Tratcher added this to the 5.0.0-preview1 milestone Nov 22, 2019
@Tratcher Tratcher self-assigned this Nov 22, 2019
@Tratcher Tratcher merged commit ca23b1a into master Nov 22, 2019
@Tratcher Tratcher deleted the tratcher/pool branch November 22, 2019 23:35
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Perf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants