Repository navigation
Conversation
The beast frontend enabled TCP_NODELAY only with tcp_nodelay=1 in rgw_frontends, and neither cephadm nor Rook sets it. With Nagle's algorithm on, a response whose body is written after its headers and is smaller than a segment waits until the client acknowledges the headers, and Linux clients delay that ACK by up to 40 ms. A 4 KiB GET took 42 ms at p50 (381/s from 16 keep-alive clients) against 1.7 ms with tcp_nodelay=1 (9,039/s), on a vstart cluster with one radosgw. Make tcp_nodelay=1 the default; tcp_nodelay=0 restores Nagle's algorithm. Fixes: https://tracker.ceph.com/issues/82657 Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
ClientIO::complete_header() flushed the headers as soon as they were complete, and send_body() wrote the body separately, so every response with a body took at least two sends. With Nagle's algorithm enabled (tcp_nodelay=0), a small body is then held until the client acknowledges the headers, up to its delayed-ACK timeout (~40ms on Linux). Leave the headers in the output buffer at complete_header(), and have the first send_body() write them and the body together, as one gathered write (BuffererSink::write_data_gather(), which StreamIO implements with one async_write of both buffers). A response without a body gets its headers flushed in complete_request(). Fixes: https://tracker.ceph.com/issues/82657 Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Dan van der Ster <[email protected]>
Contributor
Contributor
Contributor
|
added needs-qa tag |
Contributor
|
This PR has been added to wip-anrao9-testing-2026-11-13-0841-main. |
4 of 14 tasks
anthonyeleven
left a comment
Contributor
There was a problem hiding this comment.
Nice, esp. given how last I checked it was impossible to disable Nagle with Rook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


With default settings, an S3 GET of a small object from the beast frontend takes ~40 ms, which caps a keep-alive connection at ~25 small GETs per second. https://tracker.ceph.com/issues/82657 has the details.
Cause. RGW writes the response headers (
ClientIO::complete_header()flushes them) and then the body (send_body()) as separate writes. Beast setsTCP_NODELAYonly withtcp_nodelay=1inrgw_frontends, and the default is 0. With Nagle's algorithm enabled, a body smaller than a segment waits until the client acknowledges the headers, and Linux clients delay that ACK by up to 40 ms. The option was added in #27008 (2019) to match civetweb's, with Nagle on as the default. Neither cephadm nor Rook sets it. The same mechanism added 40 ms to RGW's own requests to Open Policy Agent in https://tracker.ceph.com/issues/52067.This PR fixes it twice, so that a deployment that sets
tcp_nodelay=0explicitly is fixed too:tcp_nodelaydefaults to 1 (doc and PendingReleaseNotes updated);tcp_nodelay=0restores Nagle's algorithm.complete_header()leaves them in the output buffer, and the firstsend_body()writes headers and body as one gatheredasync_write. A response without a body has its headers flushed incomplete_request(), which every request reaches. This also saves a send per response.Results. vstart, 1 memstore OSD, 1 radosgw (
rgw_thread_pool_size=512), 16 clients each with one keep-alive connection, anonymous GETs of public-read objects, 20 s per run:tcp_nodelay=0)tcp_nodelay=1tcp_nodelay=0* RGW's fixed background CPU divided over only 381 requests per second.
Testing. Besides the runs above, an S3 check passes with this PR in all three
tcp_nodelaymodes:Checklist
Assisted by Claude Code (Claude Opus 5.5).