Consider making array allocation size in HPackDecoder
configurable.
#60313
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
untriaged
Description
I've been evaluating the use of gRPC streaming in aspnet at scale for an IoT scenario. I was a little surprised to find out that a single connection requires ~50KB of memory. Since I am planning to scale to >100,000 connections, I would look to maximize the density of the connections per machine.
Looking deeper at the memory usage, a large chunk (12kb) is taken up by 3 4KB preallocated arrays in the HPackDecoder. I wonder if this size is overly aggressive in the general case w.r.t. memory consumption per connection.
Does anyone know why this size was chosen?
Regression?
No, this allocation is years old.
Data
Analysis
This is the location of the array allocations. If perhaps
https://github.com/dotnet/runtime/blob/0f0f8ce751134cccf11e47c90f781597039146ef/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecoder.cs#L116-118
The text was updated successfully, but these errors were encountered: