Investigate removing locks from HttpOutputProducers and having more coarse locking.
Open
affected-very-few
area-networking
enhancement
feature-kestrel
Perf
severity-nice-to-have
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
Today, every call to write/flush in the HttpOutputProducers acquires a lock (for example: https://github.com/aspnet/AspNetCore/blob/master/src/Servers/Kestrel/Core/src/Internal/Http/Http1OutputProducer.cs#L103). This lock should never be contested as HttpContext doesn't support concurrent operations. Let's investigate if we can move the lock into HttpProtocol and improve writing performance because there are less acquisition of the lock.
cc @davidfowl @halter73
Contributor guide
Assessment
This issue has not been assessed yet.