HTTP/2 frame writer CPU usage #30829
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
HTTP2
The HTTP/2 frame writer uses
lock
to ensure only one stream can write the connection at a time. For example, Http2FrameWriter.WriteDataAsync.When a connection has many streams with frequent writes, there is a lot of contention on the lock. Profiling shows high CPU usage from threads fighting over the lock.
A potential improvement would be to change the writer to use a producer/consumer queue using
Channel<T>
. The streams add write operations to the queue and a single consumer loop is responsible for writing frames to the connection.Today:
Future:
The text was updated successfully, but these errors were encountered: