Repository navigation
umbrella: osd/scheduler: Classify subOp reads according to op priority for mClock - #69761
Conversation
The earlier output formatting was resulting in the value and string representation of the SchedulerClass being clubbed together for e.g., "3client" The formatting is now fixed to log SchedulerClass as "3 (client)". Signed-off-by: Sridhar Seshasayee <[email protected]> (cherry picked from commit 0b84dbe)
Signed-off-by: Sridhar Seshasayee <[email protected]> (cherry picked from commit 89c7b21)
Signed-off-by: Sridhar Seshasayee <[email protected]> (cherry picked from commit 913e891)
…Clock The change brings MSG_OSD_EC_READ into the fold of mClock scheduler. This improves the scheduling of client and other classes of operation as they are no longer unnecessarily preempted by the 'immediate' queue. EC SubOps are now handled as follows: - EC SubOp reads generated during recovery will either go into the 'background_recovery' or 'background_best_effort' class based on the recovery priority set for the op. EC SubOp reads generated due to client will continue to be classified as 'immediate'. - EC SubOp writes generated as a result of client operations will continue to be classified as 'immediate'. - EC SubOp replies are considered high priority and therefore continue to be classed as 'immediate'. Fixes: https://tracker.ceph.com/issues/71655 Signed-off-by: Sridhar Seshasayee <[email protected]> (cherry picked from commit a0464c3)
…cheduler
Previously, sub-op reads returned a hardcoded cost of 0, bypassing
mClock's background bandwidth and tag calculation mechanisms. This
allowed backfill operations to proceed un-metered, occasionally causing
backend resource contention and driving up client tail latencies.
Cost is calculated based on whether the complete chunk/shard or a subchunk
needs to be read. The possible cases are:
1. Read the complete chunk aligned length:
- Cost is set to the length of the chunk aligned extent size.
2. Fragmented reads:
- Consider the subchunk length and count to calculate the cost.
- compute_cost evaluates the exact layout of fragmented shard bytes on
disk by summing up the active subchunk allocations exactly once
(`fragmented_shard_bytes += k.second * subchunk_size`).
- Linear Extent Scaling: Scale the baseline footprint cleanly by
multiplying it against the true count of read extents (`tl.size()`),
achieving a highly efficient O(N) time complexity.
This linear cost model is compatible with pools running with
'allow_ec_optimizations' set to true. Under the FastEC optimized
pipeline, most operations are unified and bypass fragment slicing,
meaning requests will primarily match the Case 1 chunk-aligned path.
In Case 2 where applicable, the O(N) loop ensures that cost will
scale proportionally according to the layout.
It is important to note that the amount of data to read was set to an upper
bound defined by osd_recovery_max_chunk (8 MiB) and was rounded up to the
stripe width. The reason for setting a higher than actual upper bound is that
there may be cases where the object doesn't have the xattrs yet to determine
its size. Therefore, the amount to read was ultimatly set to ~(8 MiB / k)
where k is the number of data shards. This can cause mClock to prolong
the recovery times as items stay longer in the queue. To address this, the
amount to read is set to the remaining length of the object to recover
if the object size is known. Otherwise, the amount to read is set to the
recovery chunk size as before. Therefore, in some cases, only the first
recovery read could be costly if the object context is not known.
The MOSDECSubOpRead class introduces the following:
- cost member. This necessitates an increment to the HEAD_VERSION and
appropriate handling within the encode and decode methods.
- compute_cost() that is called when creating the message by
ECCommonL::ReadPipeline::do_read_op(). This calls into ECSubRead::cost()
that performs the actual calculations to set the cost based on the cases
mentioned above.
- The same sequence applies to the EC optimized path in
ECCommon::ReadPipeline::do_read_op().
Fixes: https://tracker.ceph.com/issues/71655
Signed-off-by: Sridhar Seshasayee <[email protected]>
(cherry picked from commit e79befe)
Add perf counters to show the status pertaining to the number of ops, dynamic queue lengths, queue latency and bytes read for the following ops handled in the high queues and in the scheduler queues: - peering - client - ec reads/writes - ec recovery reads Additional counters can be added in the future based on the requirement. Signed-off-by: Sridhar Seshasayee <[email protected]> (cherry picked from commit 5ae7768)
…tarvation Adjust the 'background_best_effort' queue parameters across the three standard mClock profiles (high_client_ops, balanced, and high_recovery_ops) to ensure best effort ops are not starved. Previously, the 'background_best_effort' queue carried a default allocation of 0% (MIN) reservation and a weight of 1 under these profiles. When concurrent client traffic is dense, the zero-reservation for example completely starves backfill sub-ops (MSG_OSD_EC_READ) on pools with 'allow_ec_optimizations' set to false. This starvation forces the Primary OSD to hold internal BlueStore transactions and PG object locks for extended windows, causing severe client median (50th) latency inflation. To prevent background starvation and resolve the effects of the primary lock retention, the profile configurations are tuned as follows: The following profile changes forces low-cost sub-ops to clear out of peer queues rapidly to drop primary locks, which helps improve the client completion latency and tail latency (95th, 99th and 99.5th) percentile. 1. high_client_ops profile: - Grant 'background_best_effort' a safe 5% minimum reservation. - Scale the queue weight to 4. 2. balanced profile: - Grant 'background_best_effort' a 5% minimum reservation. - Set the queue weight to 2. 3. high_recovery_ops profile: - Grant 'background_best_effort' a 5% minimum reservation. - Set the queue weight to 2. 4. Modify the mClock config reference documentation to reflect the tuning changes to the best-effort QoS parameters across the profiles. Note on Proportional Scaling Compatibility: Configuring these changes shifts total reservations to 105% (e.g., 50% client + 50% recovery + 5% best-effort under the Balanced profile). Under heavy concurrent saturation, mClock's internal controls resolves this gracefully via proportional down-scaling, preserving the underlying device bandwidth limits for different classes of clients. For example instead of the client being allocated 50% bandwidth, a slightly lower reservation is allocated while shifting the remaining bandwidth to the best-effort queue. This minor scaling shift is virtually unnoticeable to the client application, but it prevents the internal queue deadlocks. Signed-off-by: Sridhar Seshasayee <[email protected]> (cherry picked from commit 77421c8)
…sters Remove the warning that recommends using wpq scheduler as a fallback for EC clusters. This issue is addressed by considering EC recovery reads as background, assigning an accurate cost for those reads and tuning the QoS parameters associated with best-effort class of operations. Signed-off-by: Sridhar Seshasayee <[email protected]> (cherry picked from commit 2cf1e71)
|
@rzarzynski Please review this backport. The releng-audit failed initially since the umbrella had no 'Pull Request ID' field set. It is now set and all the commits were cherry-picked without any conflict. Thanks! |
|
jenkins test make check |
|
I have marked this PR as DNM until we get confirmation from QE that the fix works well on a larger cluster involving HDDs. |
|
This PR has been added to wip-yuri15-testing-20260723.210930-umbrella. |
@yuriw @batrick This can go through teuthology testing, but the merge can wait until I get confirmation of results from a larger testing effort underway on a HDD based cluster. I have modified the commit title accordingly. |
|
jenkins test make check arm64 |
@batrick Yes, it can be moved out until we have the results from testing. |
backport tracker: https://tracker.ceph.com/issues/77728
backport of #64618
parent tracker: https://tracker.ceph.com/issues/71655
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.