Bug #73353
closedPeriod of cluster inactivity causes PriorityCache Meta long stalls for first few IOs
0%
Description
Scenario:
1. Fill a pool with many objects of significant size, like 2MB
2. Wait for 10 minutes
3. Initiate randread with queue depth 1.
Reads here will have a very long latency.
The explanation is that in period of inactivity, PriorityCache reduces memory allocated to Onode Cache Shards.
Evicted from Onode Cache Shards happens on access to the cache, more specifically on onode cache miss.
When Priority Cache Meta memory is reduced from 2GB to 100MB, there are 1000s of onodes that will be evicted.
While evicting single onode is not particularly time-consuming operation, evicting 100s or 1000s is clearly noticeable in latency.
All the eviction is done in first access to Onode Cache Shard. There will be as many stalls as there are shards.
Replication algorithm:
1) deploy a cluster of 1 to 4 OSDs
2) create a pool #ceph osd pool create TEST_POOL 64 --pg_num_min 64
3) fill the pool (here - 400K object 2MB each) #fio --alloc-size=4G --ioengine=rados --invalidate=0 --conf=./ceph.conf --pool=TEST_POOL --touch_objects=0 --size=800000M --nrfiles=400000 '--filename_format=object.$filenum' --name=FILL --iodepth=32 --rw=write --bs=2M
4) wait 10 minutes, or observe #ceph tell osd.0 perf dump "bluestore-pricache:meta"
{
"bluestore-pricache:meta": {
"pri0_bytes": 0,
"pri1_bytes": 0,
"pri2_bytes": 0,
"pri3_bytes": 0,
"pri4_bytes": 0,
"pri5_bytes": 0,
"pri6_bytes": 0,
"pri7_bytes": 0,
"pri8_bytes": 0,
"pri9_bytes": 0,
"pri10_bytes": 0,
"pri11_bytes": 90230082,
"reserved_bytes": 77542078,
"committed_bytes": 167772160
}
}
pri0 to pri10 should be 0, this is the sign that cache will want to be small.
5) Test the incurred latency
fio --alloc-size=4G --ioengine=rados --invalidate=0 --conf=./ceph.conf --pool=TEST_POOL --touch_objects=0 --size=800000M --nrfiles=400000 '--filename_format=object.$filenum' --name=READ --iodepth=1 --rw=randread --bs=4K --io_size=4000K --file_service_type=random
fio-3.35
Starting 1 process
...
| 1.00th=[ 302], 5.00th=[ 420], 10.00th=[ 498], 20.00th=[ 652],
| 30.00th=[ 766], 40.00th=[ 865], 50.00th=[ 947], 60.00th=[ 1012],
| 70.00th=[ 1090], 80.00th=[ 1221], 90.00th=[ 1352], 95.00th=[ 1811],
| 99.00th=[229639], 99.50th=[274727], 99.90th=[350225], 99.95th=[350225],
| 99.99th=[350225]
...
For a few seconds FIO really struggles, then quickly jumps up to high IO/s.
Repeated runs give latencies in reasonable ranges:
fio-3.35
Starting 1 process
...
| 1.00th=[ 95], 5.00th=[ 113], 10.00th=[ 127], 20.00th=[ 182],
| 30.00th=[ 206], 40.00th=[ 239], 50.00th=[ 273], 60.00th=[ 314],
| 70.00th=[ 347], 80.00th=[ 400], 90.00th=[ 490], 95.00th=[ 570],
| 99.00th=[ 635], 99.50th=[ 725], 99.90th=[ 1483], 99.95th=[ 1483],
| 99.99th=[ 1483]
...
AK Updated by Adam Kupczyk about 1 year ago
- Pull request ID set to 65792
UB Updated by Upkeep Bot 6 months ago
- Status changed from Fix Under Review to Pending Backport
- Merge Commit set to c2d25e08fe07fd26fc6f253b37ff313c12ee7091
- Fixed In set to v21.0.0-2133-gc2d25e08fe
- Upkeep Timestamp set to 2026-06-09T11:54:53+00:00
UB Updated by Upkeep Bot 6 months ago
- Copied to Backport #77268: squid: Period of cluster inactivity causes PriorityCache Meta long stalls for first few IOs added
UB Updated by Upkeep Bot 6 months ago
- Copied to Backport #77269: tentacle: Period of cluster inactivity causes PriorityCache Meta long stalls for first few IOs added
UB Updated by Upkeep Bot 6 months ago
- Tags (freeform) set to backport_processed
UB Updated by Upkeep Bot 3 months ago
- Status changed from Pending Backport to Backporting
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2026-06-09T11:54:53+00:00 to 2026-08-27T18:33:59+00:00
UB Updated by Upkeep Bot 3 months ago
- Status changed from Backporting to Resolved
- Upkeep Timestamp changed from 2026-08-27T18:33:59+00:00 to 2026-09-17T01:28:08+00:00
UB Updated by Upkeep Bot about 1 month ago
- Released In set to v21.2.0~248
- Upkeep Timestamp changed from 2026-09-17T01:28:08+00:00 to 2026-10-24T02:06:59+00:00