Repository navigation
seastore: add latency distribution (p95/p99) support - #69281
Conversation
Initialize lat_hist_bounds_us bucket boundaries (0.25ms–20ms in 10 log-ish steps) for the op_lat Seastar histogram in register_metrics(), and populate them in add_latency_sample(). Previously op_lat only tracked sample_count and sample_sum, giving an average but no percentile visibility. Signed-off-by: Matan Breizman <[email protected]>
Sub-ms ops rounded to zero under the old millisecond cast, making the average meaningless for fast NVMe workloads. sample_sum is now in microseconds; divide by 1000 for ms average. Signed-off-by: Matan Breizman <[email protected]>
We’re seeing two distinct failure modes driven by conflict rate: A) spiky behaviorShard examples: 3–5 range (especially shard 4) Characteristics:
some requests experience significant latency spikes - average is still mostly ok. B) fully degraded / contention collapseShard examples: 2 and 7 Characteristics:
All requests are consistently slow, not just spiky. There seem to be a "clear" threshold around ~5% conflict:
A small increase in conflict rate causes a nonlinear impact from mostly fast operations with occasional spikes to consistently slow performance driven by retries and contention, with a tipping point around ~5%. |
jdurgin
left a comment
There was a problem hiding this comment.
Good idea to have these at the seastore level. I was thinking you might already have the client-level stats from fio, since its default output includes latency histograms from the client perspective.
|
Is each shard processing the same number of IOPS? I wonder if we're seeing side effects of workload imbalance as well in those latency numbers (perhaps more workload leading to higher conflicts, to some degree too). Even in the low cases p99 latency being 10x is quite high. To dig into those low conflict cases we'll probably need a lot more fine-tuned metrics measuring where latency is coming from for a given op. |
Add a num_replays counter to Transaction, incremented in Cache::mark_transaction_conflicted whenever a transaction is marked conflicted. Only relevant for user-MUTATE path (do_transaction_no_callbacks). Signed-off-by: Matan Breizman <[email protected]>
|
per-shard MUTATE volume seems eve. Conflict rate ranges ~1% to 5% and avg
(conflict rate = invalidated-MUTATE / created-MUTATE) I'm going to move forward with this PR, to track per-transaction retry counts (I don't see a reason to merge until the investigation is over). The idea here is to consider an "anti-starvation" mechanism if it turned out that starved commits keep getting invalidated and explain the tail lat. Retry distribution on the busiest shard (shard 0) in another run:
(deepest seen was 8 retries, by a single txn, there is no long starvation tail) We might be able to rule out conflicts as the cause:
It's likely that conflicts (and the retry tail) are a result of how loaded a shard is, not the cause. I think we need to see where the per-op time actually goes. I'll try to add a per-stage latency counters around |
Introduce a new latency breakdown metric for do_transaction, exposing per-stage timing (build, collock_wait, submit, throttler_wait). Signed-off-by: Matan Breizman <[email protected]>
|
Followup to the Per-stage stats (all is same workload as before)
This could either be Seastore's mishandling collection-lock hold time which might be needed to release earlier (if possible). Alternatively, pg mapping might be skewed (above SeaStore) since many hot pgs land on the same shard (see 0 and 4 in the test above). |
Signed-off-by: Matan Breizman <[email protected]>
@Matan-B I've been struggling to define a per component attribution in this draft pr: #69292 if you could please help to make it work would be very much appreciated |
Hey Jose, I'm breaking down the collection lock hold first, since I suspect it's more straight forward to improve. I think that improving
Yes, workload shared here: #68691 (comment)
I'm not sure I follow here, but we can keep expanding Sharing the sub-phase breakdown (last commit):
The col lock hold is ~50% |
we might be able to reduce onode lookup stage by storing the prev lookup already made when getting the obc. according to to the stats I've colleceted onode lookup takes 40% of total build time (which is ~20% of total txn time) Signed-off-by: Matan Breizman <[email protected]>
|
I've started to break down build phase as well with collecting onode lookup as well. |
|
|
Thank you! From the failures the only seastore failed ones are https://tracker.ceph.com/issues/77402 which are not related, merging. |
This is a follow up to the discussion from: #68691 (comment)
Commits:
[1]
Previous work observed ~5–10% conflict rates with a clear correlation to average latency, but lacked visibility into latency distribution and tail behavior.
This change adds histogram buckets for
DO_TRANSACTIONlatency, enabling p95/p99 analysis.Initial results show higher-conflict shards have a heavier tail, not just higher averages (will share in the comments below).
Pre:
Post:
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.