Project

General

Profile

Actions

Bug #76070

closed
TR AK

BlueStore free fragmentation check causing latency spikes

Bug #76070: BlueStore free fragmentation check causing latency spikes

Added by Thomas Rock 8 months ago. Updated about 1 month ago.

Status:
Backporting
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
tentacle, umbrella
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-3525-gea0c61b257
Released In:
Upkeep Timestamp:
2026-09-22T15:04:45+00:00

Description

My Ceph cluster was seeing anomalous write latency spikes once an hour with this being logged by the OSD "bluestore.MempoolThread fragmentation_score=0.277006 took=1.207344s"

I tracked it down to the bluestore_fragmentation_check_period which runs every hour by default and grabs locks which cause write operations to stall. The documentation says this should be almost immediate (https://github.com/ceph/ceph/blob/6cd56aece4bba8651021ce6a0f4f21b3e8b3d43e/src/common/options/global.yaml.in#L5643-L5654), but our setup was seeing this take over 1 second. I've mitigated by only running the check outside of peak hours, but wanted to post here in case other use cases see a similar slow fragmentation check.

System details:
  • Ceph version 19.2.3
  • bluestore_allocator=hybrid
  • ~0.27 fragmentation score takes about 1.21s, ~0.19 fragmentation score takes about 0.87s
  • Primarily RBD pools with both EC and replicated use cases.
  • ~20TB SATA OSD
  • Example fragmentation histogram block:

ceph daemon osd.X bluestore allocator fragmentation histogram block
[ {"max_len": 4096, "total": 18313285, "aligned": 18313285, "units": 18313285}, {"max_len": 16384, "total": 22951956, "aligned": 22951956, "units": 61228082}, {"max_len": 65536, "total": 14613416, "aligned": 14613416, "units": 123883064},
...
]


Related issues 2 (2 open — 0 closed)

Copied to bluestore - Backport #80749: tentacle: BlueStore free fragmentation check causing latency spikesNewAdam Kupczyk

Actions
Copied to bluestore - Backport #80750: umbrella: BlueStore free fragmentation check causing latency spikesNewAdam Kupczyk

Actions

IF Updated by Igor Fedotov 8 months ago Actions #1

Hey Thomas,
thanks for the report, we'll take care of that.
Meanwhile one can work around the issue by setting 'bluestore_fragmentation_check_period' to zero which will disable fragmentation polling.

Thanks,
Igor

IF Updated by Igor Fedotov 8 months ago Actions #2

  • Status changed from New to Triaged

AK Updated by Adam Kupczyk 8 months ago Actions #3

  • Assignee set to Adam Kupczyk

IF Updated by Igor Fedotov 3 months ago Actions #5

  • Status changed from Triaged to Fix Under Review
  • Pull request ID set to 71649

PD Updated by Prashant D 3 months ago Actions #6

  • Backport set to tentacle, umbrella

UB Updated by Upkeep Bot 2 months ago Actions #7

  • Copied to Backport #80749: tentacle: BlueStore free fragmentation check causing latency spikes added

UB Updated by Upkeep Bot 2 months ago Actions #8

  • Copied to Backport #80750: umbrella: BlueStore free fragmentation check causing latency spikes added

UB Updated by Upkeep Bot 2 months ago Actions #9

  • Status changed from Fix Under Review to Backporting
  • Merge Commit set to ea0c61b257fe27ceacd69630258950c747dcd2b8
  • Fixed In set to v21.3.0-3525-gea0c61b257
  • Upkeep Timestamp set to 2026-09-22T15:04:45+00:00

SG Updated by Steven Goodliff about 1 month ago Actions #10

Thanks for posting

we are seeing the same thing on v20.2.3 with it sometimes taking ~2 seconds on a OSD which is classed as having tiny fragmentation. disabled for the time being.

Actions

Also available in: PDF Atom