Repository navigation
[PR #12830/93a2b1c3 backport][3.14] Bound pipelined request queue per connection - #12854
Conversation
(cherry picked from commit 93a2b1c)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.14 #12854 +/- ##
==========================================
+ Coverage 98.08% 98.23% +0.14%
==========================================
Files 133 135 +2
Lines 48170 48590 +420
Branches 2567 2607 +40
==========================================
+ Hits 47248 47732 +484
+ Misses 735 678 -57
+ Partials 187 180 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Merging this PR will improve performance by 10.43%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_get_request_with_251308_compressed_chunked_payload[isal.isal_zlib-pyloop] |
74 ms | 67 ms | +10.43% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing patchback/backports/3.14/93a2b1c369d69ca6fcdabea9a7c29cfc7947817c/pr-12830 (51d84f4) with 3.14 (14b6ee8)2
Footnotes
-
7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
3.14(0e9cedd) during the generation of this report, so 14b6ee8 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
This is a backport of PR #12830 as merged into master (93a2b1c).
What do these changes do?
On the server, parsed HTTP/1 requests are queued per connection while one handler is active. There was no bound on how many complete pipelined requests could be buffered behind a busy handler.
This adds a per-connection cap (
MAX_MSG_QUEUE_SIZE, 32) that works at two layers:message_consumed()frees a slot.RequestHandlerpauses the transport when the queue is full and resumes once the handler drains it to half the limit, reparsing the buffered pipeline in batches.A
max_msg_queue_sizeof0keeps the old unbounded behavior, so the parser classes are unchanged for other callers.Are there changes in behavior for the user?
A single connection can now have at most
MAX_MSG_QUEUE_SIZEparsed pipelined requests waiting behind the active handler; reading is paused past that and resumes as the queue drains. Normal request/response and pipelining within the bound behave as before.Is it a substantial burden for the maintainers to support this?
No.
Related issue number
N/A
Checklist
CONTRIBUTORS.txtN/A, already listedCHANGES/folder