Skip to content

crimson/os/seastore: introduce 2Q cache replacement algorithm - #64060

Merged
Matan-B merged 11 commits into
ceph:mainfrom
zhscn:wip-seastore-2q
Jul 30, 2025
Merged

Matan-B merged 11 commits into
ceph:mainfrom
zhscn:wip-seastore-2q

Conversation

@zhscn

@zhscn zhscn commented Jun 20, 2025

Copy link
Copy Markdown
Member

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

@github-actions

github-actions Bot commented Jun 20, 2025 •

Copy link
Copy Markdown

Config Diff Tool Output

+ added: seastore_cachepin_type (crimson.yaml.in)
+ added: seastore_cachepin_2q_out_ratio (crimson.yaml.in)
+ added: seastore_cachepin_2q_in_ratio (crimson.yaml.in)
+ added: seastore_cachepin_size_pershard (crimson.yaml.in)
- removed: seastore_cache_lru_size (crimson.yaml.in)

The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.
Ignore this comment if docs are already updated. To make the "Check ceph config changes" CI check pass, please comment /config check ok and re-run the test.

@zhscn

zhscn commented Jun 20, 2025

Copy link
Copy Markdown
Member Author

The benchmark of LRU vs 2Q is WIP.

@zhscn

zhscn commented Jun 23, 2025 •

Copy link
Copy Markdown
Member Author

random read/write test

seastore_cache_lru_size = 256M

rbd image size = 5G

LRU rand write IOPS 2997
randwrite-4K: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=rbd, iodepth=768
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [w(1)][100.0%][w=12.7MiB/s][w=3245 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=3723852: Thu Jun 19 17:40:21 2025
  write: IOPS=2996, BW=11.7MiB/s (12.3MB/s)(7026MiB/600217msec); 0 zone resets
    slat (nsec): min=1398, max=1469.1k, avg=7911.04, stdev=3898.83
    clat (usec): min=997, max=8626.0k, avg=256254.79, stdev=1007684.63
     lat (usec): min=1003, max=8626.0k, avg=256262.70, stdev=1007684.62
    clat percentiles (msec):
     |  1.00th=[    4],  5.00th=[    6], 10.00th=[    7], 20.00th=[    9],
     | 30.00th=[   12], 40.00th=[   16], 50.00th=[   22], 60.00th=[   29],
     | 70.00th=[   42], 80.00th=[   70], 90.00th=[  192], 95.00th=[  961],
     | 99.00th=[ 6074], 99.50th=[ 6611], 99.90th=[ 7483], 99.95th=[ 7684],
     | 99.99th=[ 8087]
   bw (  KiB/s): min= 6296, max=17376, per=100.00%, avg=11989.85, stdev=1010.35, samples=1200
   iops        : min= 1574, max= 4344, avg=2997.43, stdev=252.56, samples=1200
  lat (usec)   : 1000=0.01%
  lat (msec)   : 2=0.01%, 4=1.04%, 10=22.29%, 20=25.17%, 50=25.49%
  lat (msec)   : 100=10.85%, 250=6.33%, 500=2.37%, 750=0.91%, 1000=0.64%
  lat (msec)   : 2000=1.25%, >=2000=3.66%
  cpu          : usr=3.09%, sys=1.43%, ctx=780131, majf=1, minf=20532
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.1%
     issued rwts: total=0,1798777,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=768

Run status group 0 (all jobs):
  WRITE: bw=11.7MiB/s (12.3MB/s), 11.7MiB/s-11.7MiB/s (12.3MB/s-12.3MB/s), io=7026MiB (7368MB), run=600217-600217msec

Disk stats (read/write):
  nvme2n1: ios=297/7020, merge=0/9446, ticks=28/1173, in_queue=1200, util=0.61%
LRU rand read IOPS 13345
randread-4K: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=rbd, iodepth=768
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [r(1)][100.0%][r=43.2MiB/s][r=11.1k IOPS][eta 00m:00s]
randread-4K: (groupid=0, jobs=1): err= 0: pid=3727861: Thu Jun 19 17:51:03 2025
  read: IOPS=13.3k, BW=52.1MiB/s (54.6MB/s)(30.5GiB/600066msec)
    slat (nsec): min=512, max=2367.5k, avg=3864.93, stdev=2718.80
    clat (usec): min=957, max=475463, avg=57586.01, stdev=7597.04
     lat (usec): min=960, max=475466, avg=57589.88, stdev=7597.11
    clat percentiles (msec):
     |  1.00th=[   49],  5.00th=[   55], 10.00th=[   56], 20.00th=[   56],
     | 30.00th=[   56], 40.00th=[   56], 50.00th=[   57], 60.00th=[   57],
     | 70.00th=[   57], 80.00th=[   61], 90.00th=[   64], 95.00th=[   66],
     | 99.00th=[   69], 99.50th=[   74], 99.90th=[  157], 99.95th=[  194],
     | 99.99th=[  271]
   bw (  KiB/s): min=43968, max=57608, per=100.00%, avg=53382.54, stdev=2697.49, samples=1199
   iops        : min=10992, max=14402, avg=13345.59, stdev=674.37, samples=1199
  lat (usec)   : 1000=0.01%
  lat (msec)   : 2=0.01%, 4=0.05%, 10=0.21%, 20=0.15%, 50=0.68%
  lat (msec)   : 100=98.65%, 250=0.25%, 500=0.02%
  cpu          : usr=9.28%, sys=6.63%, ctx=4678956, majf=0, minf=5403
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.1%
     issued rwts: total=8002040,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=768

Run status group 0 (all jobs):
   READ: bw=52.1MiB/s (54.6MB/s), 52.1MiB/s-52.1MiB/s (54.6MB/s-54.6MB/s), io=30.5GiB (32.8GB), run=600066-600066msec

Disk stats (read/write):
  nvme2n1: ios=4/6872, merge=0/9919, ticks=0/1244, in_queue=1244, util=0.57%
TwoQ rand write IOPS 3104
randwrite-4K: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=rbd, iodepth=768
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [w(1)][100.0%][w=12.4MiB/s][w=3175 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=3732873: Thu Jun 19 18:04:00 2025
  write: IOPS=3103, BW=12.1MiB/s (12.7MB/s)(7276MiB/600226msec); 0 zone resets
    slat (nsec): min=1441, max=2242.2k, avg=7864.81, stdev=3987.53
    clat (usec): min=1206, max=7413.5k, avg=247458.62, stdev=1030837.86
     lat (usec): min=1217, max=7413.5k, avg=247466.48, stdev=1030837.86
    clat percentiles (msec):
     |  1.00th=[    5],  5.00th=[    6], 10.00th=[    7], 20.00th=[    9],
     | 30.00th=[   11], 40.00th=[   14], 50.00th=[   17], 60.00th=[   22],
     | 70.00th=[   29], 80.00th=[   44], 90.00th=[   95], 95.00th=[  550],
     | 99.00th=[ 5940], 99.50th=[ 6342], 99.90th=[ 6678], 99.95th=[ 6812],
     | 99.99th=[ 7013]
   bw (  KiB/s): min= 8665, max=18492, per=100.00%, avg=12416.26, stdev=695.98, samples=1200
   iops        : min= 2166, max= 4623, avg=3104.04, stdev=174.00, samples=1200
  lat (msec)   : 2=0.01%, 4=0.93%, 10=26.88%, 20=29.18%, 50=25.73%
  lat (msec)   : 100=7.66%, 250=3.46%, 500=1.05%, 750=0.42%, 1000=0.20%
  lat (msec)   : 2000=0.34%, >=2000=4.14%
  cpu          : usr=2.83%, sys=1.84%, ctx=775673, majf=0, minf=17140
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.1%
     issued rwts: total=0,1862741,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=768

Run status group 0 (all jobs):
  WRITE: bw=12.1MiB/s (12.7MB/s), 12.1MiB/s-12.1MiB/s (12.7MB/s-12.7MB/s), io=7276MiB (7630MB), run=600226-600226msec

Disk stats (read/write):
  nvme2n1: ios=0/6831, merge=0/9466, ticks=0/1474, in_queue=1474, util=0.56%
TwoQ rand read IOPS 13287
randwrite-4K: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=rbd, iodepth=768
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [r(1)][100.0%][r=52.2MiB/s][r=13.4k IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=3736888: Thu Jun 19 18:18:26 2025
  read: IOPS=13.3k, BW=51.9MiB/s (54.4MB/s)(30.4GiB/600056msec)
    slat (nsec): min=526, max=1265.0k, avg=3711.48, stdev=2115.15
    clat (usec): min=469, max=740875, avg=57828.15, stdev=7976.97
     lat (usec): min=471, max=740878, avg=57831.86, stdev=7976.97
    clat percentiles (msec):
     |  1.00th=[   47],  5.00th=[   57], 10.00th=[   57], 20.00th=[   57],
     | 30.00th=[   58], 40.00th=[   58], 50.00th=[   58], 60.00th=[   58],
     | 70.00th=[   58], 80.00th=[   59], 90.00th=[   59], 95.00th=[   61],
     | 99.00th=[   64], 99.50th=[   72], 99.90th=[  155], 99.95th=[  194],
     | 99.99th=[  368]
   bw (  KiB/s): min=49064, max=55863, per=100.00%, avg=53149.53, stdev=604.54, samples=1199
   iops        : min=12266, max=13965, avg=13287.27, stdev=151.08, samples=1199
  lat (usec)   : 500=0.01%, 750=0.01%, 1000=0.01%
  lat (msec)   : 2=0.01%, 4=0.06%, 10=0.21%, 20=0.16%, 50=0.71%
  lat (msec)   : 100=98.60%, 250=0.24%, 500=0.02%, 750=0.01%
  cpu          : usr=9.14%, sys=5.99%, ctx=4748680, majf=0, minf=1514
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.1%
     issued rwts: total=7968473,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=768

Run status group 0 (all jobs):
   READ: bw=51.9MiB/s (54.4MB/s), 51.9MiB/s-51.9MiB/s (54.4MB/s-54.4MB/s), io=30.4GiB (32.6GB), run=600056-600056msec

Disk stats (read/write):
  nvme2n1: ios=0/7017, merge=0/9590, ticks=0/1082, in_queue=1082, util=0.57%

io replay from https://github.com/alibaba/block-traces

seastore_cache_lru_size = 2G

Select random 10 devices, 1.7TiB images size in total, replay the io trace with trace file in fio

TwoQ read IOPS 290 write IOPS 2420
Jobs: 1 (f=10): [M(1)][100.0%][r=64KiB/s,w=94.6MiB/s][r=12,w=2833 IOPS][eta 00m:01s]
replay: (groupid=0, jobs=1): err= 0: pid=4146221: Fri Jun 20 21:11:40 2025
  read: IOPS=272, BW=5359KiB/s (5487kB/s)(53.0GiB/10376877msec)
    slat (nsec): min=1410, max=252371k, avg=84884.45, stdev=1129615.07
    clat (nsec): min=367, max=2789.1M, avg=52623019.12, stdev=69628777.30
     lat (usec): min=4, max=2789.1k, avg=52708.08, stdev=69685.52
    clat percentiles (nsec):
     |  1.00th=[      1048],  5.00th=[     21888], 10.00th=[    104960],
     | 20.00th=[   3194880], 30.00th=[   7962624], 40.00th=[  17694720],
     | 50.00th=[  30277632], 60.00th=[  45875200], 70.00th=[  66846720],
     | 80.00th=[  92798976], 90.00th=[ 128450560], 95.00th=[ 168820736],
     | 99.00th=[ 304087040], 99.50th=[ 375390208], 99.90th=[ 599785472],
     | 99.95th=[ 826277888], 99.99th=[1350565888]
   bw (  KiB/s): min=    8, max=603208, per=100.00%, avg=5725.88, stdev=17103.97, samples=19425
   iops        : min=    2, max=46210, avg=290.92, stdev=910.05, samples=19425
  write: IOPS=2420, BW=113MiB/s (119MB/s)(1149GiB/10376877msec); 0 zone resets
    slat (nsec): min=1353, max=409744k, avg=279203.77, stdev=2778130.50
    clat (usec): min=625, max=4571.9k, avg=258211.01, stdev=349646.34
     lat (usec): min=891, max=4571.9k, avg=258490.45, stdev=349684.53
    clat percentiles (msec):
     |  1.00th=[    7],  5.00th=[   16], 10.00th=[   27], 20.00th=[   58],
     | 30.00th=[   90], 40.00th=[  122], 50.00th=[  155], 60.00th=[  201],
     | 70.00th=[  264], 80.00th=[  355], 90.00th=[  542], 95.00th=[  835],
     | 99.00th=[ 1921], 99.50th=[ 2366], 99.90th=[ 3138], 99.95th=[ 3339],
     | 99.99th=[ 3708]
   bw (  KiB/s): min= 1464, max=627712, per=100.00%, avg=116142.72, stdev=94950.90, samples=20753
   iops        : min=  134, max= 3826, avg=2420.72, stdev=546.13, samples=20753
  lat (nsec)   : 500=0.01%, 750=0.02%, 1000=0.01%
  lat (usec)   : 2=0.26%, 4=0.01%, 10=0.01%, 20=0.16%, 50=0.27%
  lat (usec)   : 100=0.24%, 250=0.20%, 500=0.09%, 750=0.06%, 1000=0.06%
  lat (msec)   : 2=0.28%, 4=0.58%, 10=3.29%, 20=5.31%, 50=11.22%
  lat (msec)   : 100=16.16%, 250=32.96%, 500=18.56%, 750=4.94%, 1000=1.83%
  lat (msec)   : 2000=2.67%, >=2000=0.80%
  cpu          : usr=1.90%, sys=2.83%, ctx=27933151, majf=0, minf=256054
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=2825300,25116329,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=640

Run status group 0 (all jobs):
   READ: bw=5359KiB/s (5487kB/s), 5359KiB/s-5359KiB/s (5487kB/s-5487kB/s), io=53.0GiB (56.9GB), run=10376877-10376877msec
  WRITE: bw=113MiB/s (119MB/s), 113MiB/s-113MiB/s (119MB/s-119MB/s), io=1149GiB (1234GB), run=10376877-10376877msec
LRU read IOPS 288 write IOPS 2350
Jobs: 1 (f=10): [M(1)][100.0%][r=40KiB/s,w=119MiB/s][r=6,w=2270 IOPS][eta 00m:01s]
replay: (groupid=0, jobs=1): err= 0: pid=669948: Sun Jun 22 17:01:17 2025
  read: IOPS=264, BW=5202KiB/s (5327kB/s)(53.0GiB/10689016msec)
    slat (nsec): min=1361, max=367294k, avg=53055.77, stdev=943692.49
    clat (nsec): min=361, max=2879.9M, avg=34942923.44, stdev=65166892.01
     lat (usec): min=4, max=2879.9k, avg=34996.18, stdev=65225.95
    clat percentiles (nsec):
     |  1.00th=[      1004],  5.00th=[      1128], 10.00th=[     19328],
     | 20.00th=[     84480], 30.00th=[    561152], 40.00th=[   2768896],
     | 50.00th=[   5799936], 60.00th=[  14483456], 70.00th=[  35389440],
     | 80.00th=[  65273856], 90.00th=[ 103284736], 95.00th=[ 137363456],
     | 99.00th=[ 295698432], 99.50th=[ 371195904], 99.90th=[ 599785472],
     | 99.95th=[ 792723456], 99.99th=[1266679808]
   bw (  KiB/s): min=    8, max=781840, per=100.00%, avg=5673.07, stdev=17664.53, samples=19606
   iops        : min=    2, max=47662, avg=288.23, stdev=937.37, samples=19606
  write: IOPS=2349, BW=110MiB/s (115MB/s)(1149GiB/10689016msec); 0 zone resets
    slat (nsec): min=1403, max=556872k, avg=267478.05, stdev=3137291.06
    clat (usec): min=390, max=4719.4k, avg=268142.54, stdev=368813.47
     lat (usec): min=746, max=4719.4k, avg=268410.29, stdev=368861.54
    clat percentiles (msec):
     |  1.00th=[    6],  5.00th=[   12], 10.00th=[   21], 20.00th=[   47],
     | 30.00th=[   79], 40.00th=[  109], 50.00th=[  144], 60.00th=[  194],
     | 70.00th=[  271], 80.00th=[  388], 90.00th=[  617], 95.00th=[  944],
     | 99.00th=[ 1955], 99.50th=[ 2333], 99.90th=[ 3037], 99.95th=[ 3272],
     | 99.99th=[ 3708]
   bw (  KiB/s): min=   80, max=580144, per=100.00%, avg=112768.38, stdev=81692.32, samples=21377
   iops        : min=   16, max= 3812, avg=2350.14, stdev=645.88, samples=21377
  lat (nsec)   : 500=0.03%, 750=0.04%, 1000=0.03%
  lat (usec)   : 2=0.55%, 4=0.01%, 10=0.02%, 20=0.35%, 50=0.58%
  lat (usec)   : 100=0.53%, 250=0.53%, 500=0.32%, 750=0.17%, 1000=0.13%
  lat (msec)   : 2=0.45%, 4=0.88%, 10=4.54%, 20=6.00%, 50=11.43%
  lat (msec)   : 100=15.92%, 250=28.13%, 500=16.72%, 750=6.10%, 1000=2.46%
  lat (msec)   : 2000=3.25%, >=2000=0.83%
  cpu          : usr=1.91%, sys=3.19%, ctx=30825340, majf=0, minf=741552
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=2825300,25116329,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=640

Run status group 0 (all jobs):
   READ: bw=5202KiB/s (5327kB/s), 5202KiB/s-5202KiB/s (5327kB/s-5327kB/s), io=53.0GiB (56.9GB), run=10689016-10689016msec
  WRITE: bw=110MiB/s (115MB/s), 110MiB/s-110MiB/s (115MB/s-115MB/s), io=1149GiB (1234GB), run=10689016-10689016msec

mixed io workload

seastore_cache_lru_size = 256M

rbd image size = 5G

Prepare two RBD images:

  1. For image_0, configure it for zoned I/O with a random distribution that 90% of accesses target the first 10% of the storage space.

  2. For image_1, set fio's block size option to 1MB to simulate a high-throughput IO workload.

LRU

image_0 read IOPS 911 write IOPS 911
randwrite-4K: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=rbd, iodepth=768
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [m(1)][100.0%][r=508KiB/s,w=556KiB/s][r=127,w=139 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=1041393: Mon Jun 23 12:31:46 2025
  read: IOPS=909, BW=3639KiB/s (3726kB/s)(3205MiB/901742msec)
    slat (nsec): min=529, max=1823.9k, avg=4541.52, stdev=3242.90
    clat (usec): min=326, max=15659k, avg=374830.18, stdev=2020702.01
     lat (usec): min=328, max=15659k, avg=374834.72, stdev=2020702.03
    clat percentiles (msec):
     |  1.00th=[    4],  5.00th=[    6], 10.00th=[    7], 20.00th=[    9],
     | 30.00th=[   11], 40.00th=[   12], 50.00th=[   14], 60.00th=[   16],
     | 70.00th=[   21], 80.00th=[   31], 90.00th=[   60], 95.00th=[  153],
     | 99.00th=[12684], 99.50th=[13221], 99.90th=[14295], 99.95th=[14563],
     | 99.99th=[15234]
   bw (  KiB/s): min= 1496, max= 6040, per=100.00%, avg=3645.66, stdev=629.68, samples=1800
   iops        : min=  374, max= 1510, avg=911.35, stdev=157.43, samples=1800
  write: IOPS=910, BW=3640KiB/s (3728kB/s)(3206MiB/901742msec); 0 zone resets
    slat (nsec): min=1533, max=1166.9k, avg=9347.71, stdev=4169.95
    clat (msec): min=3, max=21532, avg=469.18, stdev=2362.16
     lat (msec): min=4, max=21532, avg=469.19, stdev=2362.16
    clat percentiles (msec):
     |  1.00th=[   13],  5.00th=[   17], 10.00th=[   20], 20.00th=[   26],
     | 30.00th=[   32], 40.00th=[   37], 50.00th=[   43], 60.00th=[   50],
     | 70.00th=[   61], 80.00th=[   80], 90.00th=[  131], 95.00th=[  296],
     | 99.00th=[14832], 99.50th=[15905], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min= 1731, max= 5568, per=100.00%, avg=3646.24, stdev=549.39, samples=1800
   iops        : min=  432, max= 1392, avg=911.49, stdev=137.35, samples=1800
  lat (usec)   : 500=0.01%, 750=0.01%, 1000=0.01%
  lat (msec)   : 2=0.02%, 4=0.78%, 10=14.16%, 20=25.40%, 50=33.85%
  lat (msec)   : 100=15.49%, 250=5.48%, 500=1.04%, 750=0.35%, 1000=0.18%
  lat (msec)   : 2000=0.25%, >=2000=3.01%
  cpu          : usr=1.77%, sys=1.11%, ctx=1040966, majf=0, minf=10368
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.1%
     issued rwts: total=820370,820619,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=768

Run status group 0 (all jobs):
   READ: bw=3639KiB/s (3726kB/s), 3639KiB/s-3639KiB/s (3726kB/s-3726kB/s), io=3205MiB (3360MB), run=901742-901742msec
  WRITE: bw=3640KiB/s (3728kB/s), 3640KiB/s-3640KiB/s (3728kB/s-3728kB/s), io=3206MiB (3361MB), run=901742-901742msec

Disk stats (read/write):
  nvme2n1: ios=0/9076, merge=0/13992, ticks=0/995, in_queue=995, util=0.58%
image_1 read BW 229978 write BW 230390
randwrite-4K: (g=0): rw=randrw, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=rbd, iodepth=64
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [m(1)][100.0%][r=423MiB/s,w=419MiB/s][r=423,w=419 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=1041463: Mon Jun 23 12:31:46 2025
  read: IOPS=224, BW=225MiB/s (235MB/s)(197GiB/900165msec)
    slat (nsec): min=644, max=532275, avg=7659.88, stdev=2848.09
    clat (usec): min=1393, max=15425k, avg=120610.44, stdev=972483.50
     lat (usec): min=1398, max=15425k, avg=120618.10, stdev=972483.50
    clat percentiles (msec):
     |  1.00th=[    6],  5.00th=[    8], 10.00th=[   10], 20.00th=[   18],
     | 30.00th=[   27], 40.00th=[   34], 50.00th=[   40], 60.00th=[   45],
     | 70.00th=[   51], 80.00th=[   58], 90.00th=[   68], 95.00th=[   78],
     | 99.00th=[  334], 99.50th=[11342], 99.90th=[13355], 99.95th=[13758],
     | 99.99th=[14429]
   bw (  KiB/s): min= 8192, max=464896, per=100.00%, avg=229978.87, stdev=34189.04, samples=1800
   iops        : min=    8, max=  454, avg=224.52, stdev=33.37, samples=1800
  write: IOPS=224, BW=225MiB/s (236MB/s)(198GiB/900165msec); 0 zone resets
    slat (usec): min=157, max=5770, avg=370.33, stdev=109.39
    clat (msec): min=10, max=26686, avg=163.86, stdev=1007.33
     lat (msec): min=11, max=26687, avg=164.23, stdev=1007.34
    clat percentiles (msec):
     |  1.00th=[   27],  5.00th=[   37], 10.00th=[   43], 20.00th=[   51],
     | 30.00th=[   57], 40.00th=[   64], 50.00th=[   70], 60.00th=[   79],
     | 70.00th=[   88], 80.00th=[  101], 90.00th=[  129], 95.00th=[  171],
     | 99.00th=[  676], 99.50th=[11476], 99.90th=[14026], 99.95th=[14832],
     | 99.99th=[17113]
   bw (  KiB/s): min=51200, max=436224, per=100.00%, avg=230390.30, stdev=28005.13, samples=1799
   iops        : min=   50, max=  426, avg=224.92, stdev=27.33, samples=1799
  lat (msec)   : 2=0.01%, 4=0.09%, 10=5.04%, 20=6.28%, 50=32.95%
  lat (msec)   : 100=44.42%, 250=9.41%, 500=0.75%, 750=0.19%, 1000=0.08%
  lat (msec)   : 2000=0.11%, >=2000=0.68%
  cpu          : usr=8.54%, sys=0.67%, ctx=372155, majf=0, minf=717124
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
     issued rwts: total=202095,202355,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
   READ: bw=225MiB/s (235MB/s), 225MiB/s-225MiB/s (235MB/s-235MB/s), io=197GiB (212GB), run=900165-900165msec
  WRITE: bw=225MiB/s (236MB/s), 225MiB/s-225MiB/s (236MB/s-236MB/s), io=198GiB (212GB), run=900165-900165msec

Disk stats (read/write):
  nvme2n1: ios=0/9070, merge=0/13975, ticks=0/995, in_queue=995, util=0.58%

TwoQ

image_0 read IOPS 959 write IOPS 961
randwrite-4K: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=rbd, iodepth=768
fio-3.28
Starting 1 process
Jobs: 1 (f=0): [f(1)][100.0%][r=2016KiB/s,w=2332KiB/s][r=504,w=583 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=1035287: Mon Jun 23 12:10:26 2025
  read: IOPS=958, BW=3833KiB/s (3925kB/s)(3372MiB/900861msec)
    slat (nsec): min=584, max=1086.4k, avg=4766.00, stdev=2909.32
    clat (usec): min=422, max=26849k, avg=347246.77, stdev=2109569.61
     lat (usec): min=429, max=26849k, avg=347251.53, stdev=2109569.61
    clat percentiles (msec):
     |  1.00th=[    4],  5.00th=[    6], 10.00th=[    7], 20.00th=[    9],
     | 30.00th=[   10], 40.00th=[   12], 50.00th=[   14], 60.00th=[   17],
     | 70.00th=[   26], 80.00th=[   42], 90.00th=[   89], 95.00th=[  296],
     | 99.00th=[12550], 99.50th=[17113], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min= 1344, max= 6944, per=100.00%, avg=3837.22, stdev=699.36, samples=1800
   iops        : min=  336, max= 1736, avg=959.20, stdev=174.86, samples=1800
  write: IOPS=960, BW=3843KiB/s (3935kB/s)(3381MiB/900861msec); 0 zone resets
    slat (nsec): min=1789, max=1154.4k, avg=9963.54, stdev=3901.30
    clat (msec): min=3, max=36339, avg=453.05, stdev=2383.18
     lat (msec): min=3, max=36339, avg=453.06, stdev=2383.18
    clat percentiles (msec):
     |  1.00th=[   13],  5.00th=[   17], 10.00th=[   22], 20.00th=[   30],
     | 30.00th=[   36], 40.00th=[   43], 50.00th=[   51], 60.00th=[   61],
     | 70.00th=[   75], 80.00th=[  103], 90.00th=[  186], 95.00th=[  567],
     | 99.00th=[14295], 99.50th=[17113], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min= 1488, max= 5864, per=100.00%, avg=3846.56, stdev=632.44, samples=1800
   iops        : min=  372, max= 1466, avg=961.55, stdev=158.12, samples=1800
  lat (usec)   : 500=0.01%, 750=0.01%, 1000=0.01%
  lat (msec)   : 2=0.03%, 4=1.06%, 10=15.67%, 20=20.15%, 50=29.71%
  lat (msec)   : 100=18.47%, 250=8.40%, 500=1.73%, 750=0.57%, 1000=0.34%
  lat (msec)   : 2000=0.67%, >=2000=3.18%
  cpu          : usr=2.00%, sys=1.25%, ctx=1061616, majf=0, minf=8808
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.1%
     issued rwts: total=863247,865423,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=768

Run status group 0 (all jobs):
   READ: bw=3833KiB/s (3925kB/s), 3833KiB/s-3833KiB/s (3925kB/s-3925kB/s), io=3372MiB (3536MB), run=900861-900861msec
  WRITE: bw=3843KiB/s (3935kB/s), 3843KiB/s-3843KiB/s (3935kB/s-3935kB/s), io=3381MiB (3545MB), run=900861-900861msec

Disk stats (read/write):
  nvme2n1: ios=1/10766, merge=0/14110, ticks=0/1875, in_queue=1876, util=0.62%
image_1 read BW 208366 write BW 209470
randwrite-4K: (g=0): rw=randrw, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=rbd, iodepth=64
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [m(1)][100.0%][r=317MiB/s,w=322MiB/s][r=317,w=322 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=1035357: Mon Jun 23 12:10:26 2025
  read: IOPS=203, BW=203MiB/s (213MB/s)(179GiB/900193msec)
    slat (nsec): min=638, max=4872.8k, avg=6327.29, stdev=11658.66
    clat (usec): min=1760, max=26596k, avg=127688.19, stdev=1152052.50
     lat (usec): min=1764, max=26596k, avg=127694.52, stdev=1152052.49
    clat percentiles (msec):
     |  1.00th=[    5],  5.00th=[    7], 10.00th=[    9], 20.00th=[   16],
     | 30.00th=[   24], 40.00th=[   33], 50.00th=[   41], 60.00th=[   50],
     | 70.00th=[   58], 80.00th=[   67], 90.00th=[   81], 95.00th=[   93],
     | 99.00th=[  363], 99.50th=[ 5537], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min=20480, max=414525, per=100.00%, avg=208366.67, stdev=30063.59, samples=1800
   iops        : min=   20, max=  404, avg=203.35, stdev=29.34, samples=1800
  write: IOPS=204, BW=204MiB/s (214MB/s)(180GiB/900193msec); 0 zone resets
    slat (usec): min=153, max=4636, avg=353.90, stdev=77.79
    clat (msec): min=8, max=36301, avg=185.80, stdev=1235.61
     lat (msec): min=9, max=36302, avg=186.15, stdev=1235.61
    clat percentiles (msec):
     |  1.00th=[   27],  5.00th=[   37], 10.00th=[   43], 20.00th=[   52],
     | 30.00th=[   61], 40.00th=[   69], 50.00th=[   78], 60.00th=[   88],
     | 70.00th=[  100], 80.00th=[  117], 90.00th=[  153], 95.00th=[  201],
     | 99.00th=[  877], 99.50th=[ 7550], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min=114917, max=404264, per=100.00%, avg=209470.59, stdev=24696.10, samples=1799
   iops        : min=  112, max=  394, avg=204.43, stdev=24.10, samples=1799
  lat (msec)   : 2=0.01%, 4=0.11%, 10=6.09%, 20=6.84%, 50=26.48%
  lat (msec)   : 100=43.84%, 250=14.49%, 500=1.00%, 750=0.20%, 1000=0.10%
  lat (msec)   : 2000=0.14%, >=2000=0.72%
  cpu          : usr=7.41%, sys=0.52%, ctx=341584, majf=0, minf=499447
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
     issued rwts: total=183049,183917,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
   READ: bw=203MiB/s (213MB/s), 203MiB/s-203MiB/s (213MB/s-213MB/s), io=179GiB (192GB), run=900193-900193msec
  WRITE: bw=204MiB/s (214MB/s), 204MiB/s-204MiB/s (214MB/s-214MB/s), io=180GiB (193GB), run=900193-900193msec

Disk stats (read/write):
  nvme2n1: ios=1/10743, merge=0/14076, ticks=0/1873, in_queue=1874, util=0.62%

@zhscn
zhscn marked this pull request as ready for review June 23, 2025 04:55
@zhscn
zhscn requested a review from a team as a code owner June 23, 2025 04:55
@zhscn

zhscn commented Jun 23, 2025

Copy link
Copy Markdown
Member Author

The case which needs attention is that in 'mixed IO workload,' the throughput of the TwoQ implementation is worse than that of LRU. This decrease appears to be caused by searching for extents in the warm out queue, which is implemented using std::map.

@zhscn

zhscn commented Jun 23, 2025 •

Copy link
Copy Markdown
Member Author

Replace the impl of warm out queue to boost::unordered_flat_map and re-test:

  1. fill the two images sequentially
  2. restart OSD to clear the cache in meory
  3. run fio
image_0
[global]
ioengine=rbd
clientname=fio
pool=rbd
rbdname=test_image_0
direct=1
sync=1
time_based=1
runtime=900
randrepeat=0

[randwrite-4K]
rw=randrw
bs=4k
numjobs=1
iodepth=768
random_distribution=zoned:90/10:10/90
image_1
[global]
ioengine=rbd
clientname=fio
pool=rbd
rbdname=test_image_1
direct=1
sync=1
time_based=1
runtime=900
randrepeat=0

[randwrite-4K]
rw=randrw
bs=1M
numjobs=1
iodepth=64

LRU

image_0 read IOPS 907 write IOPS 910
randwrite-4K: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=rbd, iodepth=768
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [m(1)][100.0%][r=3448KiB/s,w=3364KiB/s][r=862,w=841 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=1153926: Mon Jun 23 16:53:13 2025
  read: IOPS=907, BW=3629KiB/s (3716kB/s)(3192MiB/900772msec)
    slat (nsec): min=569, max=642515, avg=4688.71, stdev=2570.62
    clat (usec): min=510, max=27094k, avg=344460.88, stdev=1486429.85
     lat (usec): min=514, max=27094k, avg=344465.57, stdev=1486429.84
    clat percentiles (msec):
     |  1.00th=[    4],  5.00th=[    6], 10.00th=[    7], 20.00th=[    9],
     | 30.00th=[   10], 40.00th=[   12], 50.00th=[   15], 60.00th=[   24],
     | 70.00th=[   40], 80.00th=[   73], 90.00th=[  239], 95.00th=[ 1955],
     | 99.00th=[ 7148], 99.50th=[ 8423], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min= 1208, max= 6544, per=100.00%, avg=3632.37, stdev=793.84, samples=1800
   iops        : min=  302, max= 1636, avg=907.97, stdev=198.48, samples=1800
  write: IOPS=909, BW=3640KiB/s (3727kB/s)(3202MiB/900772msec); 0 zone resets
    slat (nsec): min=1753, max=921929, avg=9761.98, stdev=4034.50
    clat (msec): min=4, max=29936, avg=500.59, stdev=1815.33
     lat (msec): min=4, max=29936, avg=500.60, stdev=1815.33
    clat percentiles (msec):
     |  1.00th=[   12],  5.00th=[   18], 10.00th=[   24], 20.00th=[   35],
     | 30.00th=[   44], 40.00th=[   54], 50.00th=[   65], 60.00th=[   81],
     | 70.00th=[  109], 80.00th=[  167], 90.00th=[  464], 95.00th=[ 3104],
     | 99.00th=[ 8926], 99.50th=[10537], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min= 1290, max= 4864, per=100.00%, avg=3642.99, stdev=720.45, samples=1800
   iops        : min=  322, max= 1216, avg=910.64, stdev=180.13, samples=1800
  lat (usec)   : 750=0.01%, 1000=0.01%
  lat (msec)   : 2=0.02%, 4=1.01%, 10=15.14%, 20=16.02%, 50=23.27%
  lat (msec)   : 100=20.20%, 250=12.16%, 500=3.66%, 750=1.24%, 1000=0.66%
  lat (msec)   : 2000=1.23%, >=2000=5.38%
  cpu          : usr=1.92%, sys=1.13%, ctx=1017839, majf=0, minf=22357
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.1%
     issued rwts: total=817176,819611,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=768

Run status group 0 (all jobs):
   READ: bw=3629KiB/s (3716kB/s), 3629KiB/s-3629KiB/s (3716kB/s-3716kB/s), io=3192MiB (3347MB), run=900772-900772msec
  WRITE: bw=3640KiB/s (3727kB/s), 3640KiB/s-3640KiB/s (3727kB/s-3727kB/s), io=3202MiB (3357MB), run=900772-900772msec

Disk stats (read/write):
  nvme2n1: ios=0/10486, merge=0/13477, ticks=0/1070, in_queue=1069, util=0.63%
image_1 read BW 209651 write BW 209524
randwrite-4K: (g=0): rw=randrw, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=rbd, iodepth=64
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [m(1)][100.0%][r=280MiB/s,w=250MiB/s][r=280,w=250 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=1153996: Mon Jun 23 16:53:13 2025
  read: IOPS=204, BW=205MiB/s (214MB/s)(180GiB/900292msec)
    slat (nsec): min=660, max=128401, avg=6828.67, stdev=2195.15
    clat (usec): min=1689, max=25803k, avg=120519.92, stdev=802119.75
     lat (usec): min=1697, max=25803k, avg=120526.75, stdev=802119.75
    clat percentiles (msec):
     |  1.00th=[    5],  5.00th=[    7], 10.00th=[    9], 20.00th=[   16],
     | 30.00th=[   35], 40.00th=[   51], 50.00th=[   65], 60.00th=[   78],
     | 70.00th=[   88], 80.00th=[  100], 90.00th=[  115], 95.00th=[  131],
     | 99.00th=[  877], 99.50th=[ 3641], 99.90th=[16174], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min=120832, max=371430, per=100.00%, avg=209651.64, stdev=31354.20, samples=1800
   iops        : min=  118, max=  362, avg=204.59, stdev=30.59, samples=1800
  write: IOPS=204, BW=204MiB/s (214MB/s)(180GiB/900292msec); 0 zone resets
    slat (usec): min=196, max=4998, avg=364.47, stdev=81.41
    clat (msec): min=10, max=31552, avg=192.07, stdev=858.61
     lat (msec): min=11, max=31553, avg=192.44, stdev=858.61
    clat percentiles (msec):
     |  1.00th=[   36],  5.00th=[   48], 10.00th=[   56], 20.00th=[   70],
     | 30.00th=[   85], 40.00th=[   99], 50.00th=[  111], 60.00th=[  124],
     | 70.00th=[  140], 80.00th=[  161], 90.00th=[  211], 95.00th=[  300],
     | 99.00th=[ 1502], 99.50th=[ 4245], 99.90th=[15637], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min=102400, max=348857, per=100.00%, avg=209524.98, stdev=25781.38, samples=1800
   iops        : min=  100, max=  340, avg=204.47, stdev=25.15, samples=1800
  lat (msec)   : 2=0.01%, 4=0.11%, 10=6.36%, 20=4.76%, 50=11.68%
  lat (msec)   : 100=38.41%, 250=34.23%, 500=2.59%, 750=0.51%, 1000=0.22%
  lat (msec)   : 2000=0.35%, >=2000=0.78%
  cpu          : usr=7.66%, sys=0.55%, ctx=342447, majf=0, minf=561450
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
     issued rwts: total=184152,184065,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
   READ: bw=205MiB/s (214MB/s), 205MiB/s-205MiB/s (214MB/s-214MB/s), io=180GiB (193GB), run=900292-900292msec
  WRITE: bw=204MiB/s (214MB/s), 204MiB/s-204MiB/s (214MB/s-214MB/s), io=180GiB (193GB), run=900292-900292msec

Disk stats (read/write):
  nvme2n1: ios=0/10486, merge=0/13477, ticks=0/1070, in_queue=1069, util=0.63%

TwoQ

image_0 read IOPS 969 write IOPS 967
randwrite-4K: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=rbd, iodepth=768
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [m(1)][100.0%][r=728KiB/s,w=540KiB/s][r=182,w=135 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=1145826: Mon Jun 23 16:25:36 2025
  read: IOPS=967, BW=3872KiB/s (3965kB/s)(3408MiB/901376msec)
    slat (nsec): min=536, max=1422.9k, avg=4624.27, stdev=2830.56
    clat (usec): min=325, max=29208k, avg=358575.86, stdev=2713039.87
     lat (usec): min=330, max=29208k, avg=358580.49, stdev=2713039.87
    clat percentiles (msec):
     |  1.00th=[    4],  5.00th=[    5], 10.00th=[    7], 20.00th=[    8],
     | 30.00th=[    9], 40.00th=[   11], 50.00th=[   12], 60.00th=[   15],
     | 70.00th=[   22], 80.00th=[   34], 90.00th=[   65], 95.00th=[  121],
     | 99.00th=[17113], 99.50th=[17113], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min= 1579, max= 7568, per=100.00%, avg=3877.99, stdev=657.42, samples=1800
   iops        : min=  394, max= 1892, avg=969.41, stdev=164.38, samples=1800
  write: IOPS=965, BW=3863KiB/s (3955kB/s)(3400MiB/901376msec); 0 zone resets
    slat (nsec): min=1718, max=2873.4k, avg=9756.94, stdev=5337.53
    clat (msec): min=4, max=38732, avg=435.89, stdev=2977.87
     lat (msec): min=4, max=38732, avg=435.90, stdev=2977.87
    clat percentiles (msec):
     |  1.00th=[   12],  5.00th=[   16], 10.00th=[   20], 20.00th=[   28],
     | 30.00th=[   34], 40.00th=[   40], 50.00th=[   46], 60.00th=[   55],
     | 70.00th=[   68], 80.00th=[   90], 90.00th=[  142], 95.00th=[  239],
     | 99.00th=[17113], 99.50th=[17113], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min= 1707, max= 5944, per=100.00%, avg=3868.53, stdev=594.26, samples=1800
   iops        : min=  426, max= 1486, avg=967.05, stdev=148.59, samples=1800
  lat (usec)   : 500=0.01%, 750=0.01%, 1000=0.01%
  lat (msec)   : 2=0.04%, 4=1.21%, 10=17.44%, 20=21.11%, 50=30.96%
  lat (msec)   : 100=17.76%, 250=7.77%, 500=1.41%, 750=0.32%, 1000=0.13%
  lat (msec)   : 2000=0.20%, >=2000=1.66%
  cpu          : usr=2.01%, sys=1.17%, ctx=1059895, majf=0, minf=6417
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.1%
     issued rwts: total=872447,870392,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=768

Run status group 0 (all jobs):
   READ: bw=3872KiB/s (3965kB/s), 3872KiB/s-3872KiB/s (3965kB/s-3965kB/s), io=3408MiB (3574MB), run=901376-901376msec
  WRITE: bw=3863KiB/s (3955kB/s), 3863KiB/s-3863KiB/s (3955kB/s-3955kB/s), io=3400MiB (3565MB), run=901376-901376msec

Disk stats (read/write):
  nvme2n1: ios=0/10404, merge=0/14451, ticks=0/1093, in_queue=1094, util=0.64%
image_1 read BW 216875 write BW 216546
randwrite-4K: (g=0): rw=randrw, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=rbd, iodepth=64
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [m(1)][100.0%][r=414MiB/s,w=401MiB/s][r=414,w=401 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=1145899: Mon Jun 23 16:25:36 2025
  read: IOPS=211, BW=212MiB/s (222MB/s)(186GiB/900204msec)
    slat (nsec): min=643, max=162660, avg=6372.16, stdev=1964.01
    clat (usec): min=1515, max=27603k, avg=122437.39, stdev=1387126.68
     lat (usec): min=1521, max=27603k, avg=122443.76, stdev=1387126.68
    clat percentiles (msec):
     |  1.00th=[    5],  5.00th=[    7], 10.00th=[    9], 20.00th=[   16],
     | 30.00th=[   23], 40.00th=[   29], 50.00th=[   35], 60.00th=[   40],
     | 70.00th=[   46], 80.00th=[   52], 90.00th=[   61], 95.00th=[   69],
     | 99.00th=[  153], 99.50th=[  676], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min=43008, max=417792, per=100.00%, avg=216875.60, stdev=30462.33, samples=1799
   iops        : min=   42, max=  408, avg=211.71, stdev=29.74, samples=1799
  write: IOPS=211, BW=211MiB/s (222MB/s)(186GiB/900204msec); 0 zone resets
    slat (usec): min=176, max=2566, avg=353.77, stdev=80.47
    clat (msec): min=6, max=37200, avg=179.78, stdev=1517.16
     lat (msec): min=7, max=37201, avg=180.13, stdev=1517.16
    clat percentiles (msec):
     |  1.00th=[   27],  5.00th=[   36], 10.00th=[   41], 20.00th=[   49],
     | 30.00th=[   55], 40.00th=[   62], 50.00th=[   69], 60.00th=[   77],
     | 70.00th=[   87], 80.00th=[  102], 90.00th=[  134], 95.00th=[  178],
     | 99.00th=[  447], 99.50th=[ 1385], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min=12288, max=395264, per=100.00%, avg=216546.17, stdev=24405.72, samples=1799
   iops        : min=   12, max=  386, avg=211.39, stdev=23.82, samples=1799
  lat (msec)   : 2=0.01%, 4=0.11%, 10=6.13%, 20=7.01%, 50=37.05%
  lat (msec)   : 100=38.49%, 250=9.64%, 500=0.87%, 750=0.15%, 1000=0.05%
  lat (msec)   : 2000=0.06%, >=2000=0.44%
  cpu          : usr=7.72%, sys=0.47%, ctx=353564, majf=0, minf=589878
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
     issued rwts: total=190569,190289,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
   READ: bw=212MiB/s (222MB/s), 212MiB/s-212MiB/s (222MB/s-222MB/s), io=186GiB (200GB), run=900204-900204msec
  WRITE: bw=211MiB/s (222MB/s), 211MiB/s-211MiB/s (222MB/s-222MB/s), io=186GiB (200GB), run=900204-900204msec

Disk stats (read/write):
  nvme2n1: ios=0/10394, merge=0/14434, ticks=0/1087, in_queue=1087, util=0.64%

@zhscn
zhscn force-pushed the wip-seastore-2q branch from 55daaa6 to f87787a Compare June 23, 2025 09:06

@cyx1231st cyx1231st left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This decrease appears to be caused by searching for extents in the warm out queue, which is implemented using std::map.

LRU/2Q needs to be efficient as part of the critical path.

Do you see any regressions after the optimization from the first 2 workloads?
(Seems 2Q is a generally better algorithm than LRU, worth considering to make it default, but needs some proves)

There are several other points worth considering:

  • To make 2Q really effective, I think it is essential to make sure in SeaStore we don't call touch_extent() multiple times per access.
  • Do we have metrics in 2Q to understand/prove the above property under a sequential workload?

Comment thread src/common/options/crimson.yaml.in Resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can A1 queue deal with (distinguish) sequential partial reads inside the same large extent?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, need to rethink it.

@zhscn zhscn Jun 24, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "mixed io workload" test setup is that first fill the image with bs=1M io_depth=64, then randrw with bs=1M.

The new test setup could be fill image with bs=4M and randrs with bs=1M to test this case.

@zhscn zhscn Jun 24, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TwoQ partial reads inside the same large extent test with bs=4M to fill image sequentially and do randrw with bs=1M:

image_0 read IOPS 967 write IOPS 967
randwrite-4K: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=rbd, iodepth=768
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [m(1)][100.0%][r=276KiB/s,w=368KiB/s][r=69,w=92 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=1537237: Tue Jun 24 13:09:44 2025
  read: IOPS=966, BW=3864KiB/s (3957kB/s)(3400MiB/900941msec)
    slat (nsec): min=543, max=974912, avg=4601.79, stdev=2810.96
    clat (usec): min=437, max=19434k, avg=348234.88, stdev=2120535.79
     lat (usec): min=443, max=19434k, avg=348239.48, stdev=2120535.80
    clat percentiles (msec):
     |  1.00th=[    3],  5.00th=[    5], 10.00th=[    6], 20.00th=[    8],
     | 30.00th=[    9], 40.00th=[   11], 50.00th=[   12], 60.00th=[   15],
     | 70.00th=[   22], 80.00th=[   38], 90.00th=[   83], 95.00th=[  207],
     | 99.00th=[15100], 99.50th=[16174], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min= 1402, max= 7032, per=100.00%, avg=3869.02, stdev=676.19, samples=1800
   iops        : min=  350, max= 1758, avg=967.16, stdev=169.06, samples=1800
  write: IOPS=966, BW=3867KiB/s (3960kB/s)(3402MiB/900941msec); 0 zone resets
    slat (nsec): min=1867, max=1606.6k, avg=9801.06, stdev=4622.94
    clat (msec): min=3, max=26995, avg=446.40, stdev=2422.64
     lat (msec): min=3, max=26995, avg=446.41, stdev=2422.64
    clat percentiles (msec):
     |  1.00th=[   12],  5.00th=[   16], 10.00th=[   20], 20.00th=[   27],
     | 30.00th=[   34], 40.00th=[   40], 50.00th=[   47], 60.00th=[   57],
     | 70.00th=[   71], 80.00th=[   99], 90.00th=[  178], 95.00th=[  401],
     | 99.00th=[16979], 99.50th=[17113], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min= 1482, max= 5368, per=100.00%, avg=3870.95, stdev=615.69, samples=1800
   iops        : min=  370, max= 1342, avg=967.65, stdev=153.94, samples=1800
  lat (usec)   : 500=0.01%, 750=0.01%, 1000=0.01%
  lat (msec)   : 2=0.12%, 4=1.98%, 10=17.73%, 20=19.90%, 50=29.42%
  lat (msec)   : 100=16.90%, 250=8.12%, 500=2.04%, 750=0.60%, 1000=0.29%
  lat (msec)   : 2000=0.40%, >=2000=2.49%
  cpu          : usr=1.98%, sys=1.18%, ctx=1058456, majf=0, minf=14175
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.1%
     issued rwts: total=870420,870954,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=768

Run status group 0 (all jobs):
   READ: bw=3864KiB/s (3957kB/s), 3864KiB/s-3864KiB/s (3957kB/s-3957kB/s), io=3400MiB (3565MB), run=900941-900941msec
  WRITE: bw=3867KiB/s (3960kB/s), 3867KiB/s-3867KiB/s (3960kB/s-3960kB/s), io=3402MiB (3567MB), run=900941-900941msec

Disk stats (read/write):
  nvme2n1: ios=0/10623, merge=0/13962, ticks=0/2598, in_queue=2598, util=0.60%
image_0 read BW 214372 write BW 214007
randwrite-4K: (g=0): rw=randrw, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=rbd, iodepth=64
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [m(1)][100.0%][r=340MiB/s,w=340MiB/s][r=340,w=340 IOPS][eta 00m:00s]
randwrite-4K: (groupid=0, jobs=1): err= 0: pid=1537307: Tue Jun 24 13:09:44 2025
  read: IOPS=209, BW=209MiB/s (219MB/s)(184GiB/900175msec)
    slat (nsec): min=640, max=89951, avg=6270.64, stdev=1926.81
    clat (usec): min=1050, max=19207k, avg=124865.27, stdev=1157797.72
     lat (usec): min=1056, max=19207k, avg=124871.54, stdev=1157797.72
    clat percentiles (msec):
     |  1.00th=[    3],  5.00th=[    6], 10.00th=[    7], 20.00th=[   11],
     | 30.00th=[   17], 40.00th=[   23], 50.00th=[   30], 60.00th=[   36],
     | 70.00th=[   44], 80.00th=[   52], 90.00th=[   63], 95.00th=[   75],
     | 99.00th=[  249], 99.50th=[13489], 99.90th=[16442], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min=124928, max=364544, per=100.00%, avg=214372.25, stdev=30183.69, samples=1800
   iops        : min=  122, max=  356, avg=209.21, stdev=29.46, samples=1800
  write: IOPS=208, BW=209MiB/s (219MB/s)(184GiB/900175msec); 0 zone resets
    slat (usec): min=149, max=5306, avg=354.52, stdev=85.51
    clat (msec): min=7, max=25757, avg=180.99, stdev=1246.29
     lat (msec): min=7, max=25758, avg=181.34, stdev=1246.29
    clat percentiles (msec):
     |  1.00th=[   23],  5.00th=[   31], 10.00th=[   36], 20.00th=[   44],
     | 30.00th=[   51], 40.00th=[   58], 50.00th=[   66], 60.00th=[   74],
     | 70.00th=[   86], 80.00th=[  102], 90.00th=[  136], 95.00th=[  186],
     | 99.00th=[  667], 99.50th=[14026], 99.90th=[17113], 99.95th=[17113],
     | 99.99th=[17113]
   bw (  KiB/s): min=86016, max=391168, per=100.00%, avg=214007.60, stdev=24038.86, samples=1800
   iops        : min=   84, max=  382, avg=208.86, stdev=23.46, samples=1800
  lat (msec)   : 2=0.17%, 4=0.95%, 10=8.53%, 20=8.52%, 50=36.00%
  lat (msec)   : 100=34.60%, 250=9.28%, 500=0.94%, 750=0.19%, 1000=0.07%
  lat (msec)   : 2000=0.08%, >=2000=0.68%
  cpu          : usr=7.67%, sys=0.45%, ctx=348428, majf=0, minf=646508
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
     issued rwts: total=188318,188006,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
   READ: bw=209MiB/s (219MB/s), 209MiB/s-209MiB/s (219MB/s-219MB/s), io=184GiB (197GB), run=900175-900175msec
  WRITE: bw=209MiB/s (219MB/s), 209MiB/s-209MiB/s (219MB/s-219MB/s), io=184GiB (197GB), run=900175-900175msec

Disk stats (read/write):
  nvme2n1: ios=0/10617, merge=0/13943, ticks=0/2598, in_queue=2597, util=0.60%

At least it's not worse than LRU...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least it's not worse than LRU...

Yeah, I also agree that 2Q is a generally better algorithm (if implemented properly).

Can A1 queue deal with (distinguish) sequential partial reads inside the same large extent?

I think it's commen that extent granularity isn't align with reads, and IIUC it can cause an extent to be touched multiple times and be promoted to the main buffer inappropriately.

Probably we can add a TODO comment to the class, and deal with it in the next step.

@zhscn zhscn Jun 24, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC it can cause an extent to be touched multiple times and be promoted to the main buffer inappropriately.

Make sence, one naive idea is that maintain a visit bitmap in ObjectDataBlock and the entry in warm out queue or similar structure like LRU/LFU bufferlist in one extent so that we could evict the data in a fine-grained granularity

@cyx1231st cyx1231st Jun 24, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, a visit bitmap seems unnecessary until really needed.

Probably good enough to start with simply remembering the last access end-offset of every extent from the A1 queue, encapsulated inside Q2 solution, I suppose?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method works well, filtering out nearly half of the accesses to the warm out queue in pure high throughput read cases(rw=randread bw=1M) compared to the previous approach.

@zhscn

zhscn commented Jun 24, 2025

Copy link
Copy Markdown
Member Author

LRU/2Q needs to be efficient as part of the critical path.

Do you see any regressions after the optimization from the first 2 workloads?

Not test yet, I will test and profile it again.

  • To make 2Q really effective, I think it is essential to make sure in SeaStore we don't call touch_extent() multiple times per access.

The actual overhead of 2Q compared to LRU is that when an extent isn't found in either the warm_in or hot queue(CachedExtent::primary_ref_list_hook), it needs to search through the warm_out queue (implemented as an laddr-indexed hash table) to check for previous access. However, once extents are added to the warm_in/hot queue, subsequent touches won't trigger warm_out searches because CachedExtent::primary_ref_list_hook is linked. Therefore, suppressing multiple touch_extent() invocations seems unnecessary.

  • Do we have metrics in 2Q to understand/prove the above property under a sequential workload?

Probably not, if we had metrics that could filter out the sequential request reliably, we could drop 2Q algorithm completely. However, we could add some metrics to track an extent's queue location during touch operations.

We could also do another priori benchmark using static-layout-laddr. Establish mappings from rados object name and clone prefix laddr in seastore and we could examine 2Q's laddrs to determine if extents are from sequential workloads. Previous results showed that the 95% of extents from sequential workload image reside in warm_in queue, with fewer than 5% in the hot queue.

@cyx1231st

cyx1231st commented Jun 24, 2025 •

Copy link
Copy Markdown
Member

To make 2Q really effective, I think it is essential to make sure in SeaStore we don't call touch_extent() multiple times per access.

The actual overhead of 2Q compared to LRU is that when an extent isn't found in either the warm_in or hot queue(CachedExtent::primary_ref_list_hook), it needs to search through the warm_out queue (implemented as an laddr-indexed hash table) to check for previous access. However, once extents are added to the warm_in/hot queue, subsequent touches won't trigger warm_out searches because CachedExtent::primary_ref_list_hook is linked. Therefore, suppressing multiple touch_extent() invocations seems unnecessary.

I meant, see #64060 (comment), if an extent is touched multiple times in a single access, it will be wrongly promoted to the main buffer, which beats the design goal.

Probably not, if we had metrics that could filter out the sequential request reliably, we could drop 2Q algorithm completely.

I meant to use certain workload (e.g. pure sequential) to understand whether/how-much the design goal is enforced.

Previous results showed that the 95% of extents from sequential workload image reside in warm_in queue, with fewer than 5% in the hot queue.

Observability is equally important, I think. For example, ideally, under pure sequentail reads, no ObjectDataExtent should be possible in the main buffer, no matter how they were written, otherwise there must be something missing (e.g. duplicated touch_extent(), partial-read not supported, etc.). It is also important to have an easy way to make sure there is no regression in the future.

@cyx1231st cyx1231st moved this to In Progress in Crimson Jun 24, 2025
@zhscn

zhscn commented Jun 24, 2025

Copy link
Copy Markdown
Member Author

Observability is equally important, I think. For example, ideally, under pure sequentail reads, no ObjectDataExtent should be possible in the main buffer, no matter how they were written, otherwise there must be something missing (e.g. duplicated touch_extent(), partial-read not supported, etc.). It is also important to have an easy way to make sure there is no regression in the future.

Okay, I get it.

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@zhscn
zhscn force-pushed the wip-seastore-2q branch from f87787a to 3570d9d Compare June 26, 2025 05:40
@zhscn
zhscn force-pushed the wip-seastore-2q branch 2 times, most recently from 992f8be to 99952fc Compare June 26, 2025 10:21
Comment thread src/common/options/crimson.yaml.in Resolved
Comment thread src/common/options/crimson.yaml.in Resolved
Comment thread src/crimson/os/seastore/cache.cc Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
@zhscn

zhscn commented Jun 27, 2025

Copy link
Copy Markdown
Member Author

Other comments will be resolved in next push.

@zhscn

zhscn commented Jul 16, 2025

Copy link
Copy Markdown
Member Author

jenkins test api

@cyx1231st cyx1231st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final comments, LGTM!

Note, 2Q is not included in CI. If wish to prevent regressions, probably good to randomize LRU vs 2Q configurations in the qa tests.

Comment thread src/common/options/crimson.yaml.in Resolved
@zhscn
zhscn force-pushed the wip-seastore-2q branch from fd6283b to ada324b Compare July 18, 2025 06:27
@zhscn

zhscn commented Jul 21, 2025

Copy link
Copy Markdown
Member Author

jenkins test make check

@cyx1231st cyx1231st moved this from In Progress to Needs QA in Crimson Jul 23, 2025
@Matan-B

Matan-B commented Jul 23, 2025 •

Copy link
Copy Markdown
Contributor

Final comments, LGTM!

Note, 2Q is not included in CI. If wish to prevent regressions, probably good to randomize LRU vs 2Q configurations in the qa tests.

We can add 2Q as an option to be randomly selected when triggering jobs.
Note, this will only be a change in qa dir, no need for a rebuild. I can look into it after the PR merges.
For testing purposes, I think we should schedule a 2 runs, one without 2q and the other with 2q by default.
@cyx1231st, What do you think?

We can do this by selecting a new qa branch which would include only 2q:
--suite-repo https://github.com/<fork>/ceph.git --suite-branch 2q-default-testing
The branch additional commit would be:

- name: seastore_cachepin_type
  type: str
  level: dev
  desc: The cache replacement algorithm used by extent pinboard in seastore. (LRU/2Q)
-  default: LRU
+  default: 2Q

We could use the same build sha1 for both tests.


Generally speaking, do we want to consider this as the new default once verified?

@cyx1231st

Copy link
Copy Markdown
Member

We can add 2Q as an option to be randomly selected when triggering jobs.

Yeah, IIRC @zhscn won't include random QA part in this PR, not familiar with it yet.

For testing purposes, I think we should schedule a 2 runs, one without 2q and the other with 2q by default.
@cyx1231st, What do you think?

Yeah, this is a better decision, I was thinking about only testing the default option, and validate 2Q after QA is improved in the next PR. (so it can be done in batches)

Generally speaking, do we want to consider this as the new default once verified?

If there is bandwidth, probably good to double confirm in sepia that there is no regression in our standard perf tests.

However, from @zhscn's local evaluation, and also in theory, it has general benefits.

@cyx1231st

Copy link
Copy Markdown
Member

@Matan-B

Matan-B commented Jul 23, 2025

Copy link
Copy Markdown
Contributor

We can add 2Q as an option to be randomly selected when triggering jobs.

Yeah, IIRC @zhscn won't include random QA part in this PR, not familiar with it yet.

Let's address this (random qa) after merging this PR. I'll open a tracker.

For testing purposes, I think we should schedule a 2 runs, one without 2q and the other with 2q by default.
@cyx1231st, What do you think?

Yeah, this is a better decision, I was thinking about only testing the default option, and validate 2Q after QA is improved in the next PR. (so it can be done in batches)

I'm ok with both, I think it should be nice to test 2q as default just for sanity prior to merging (even if it won't be perfect, we can keep polishing it after merge).

Generally speaking, do we want to consider this as the new default once verified?

If there is bandwidth, probably good to double confirm in sepia that there is no regression in our standard perf tests.
However, from @zhscn's local evaluation, and also in theory, it has general benefits.

Ack. We can start with adding this as an option and then consider switching default.

@Matan-B

Matan-B commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

@Matan-B

Matan-B commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

@Matan-B
Matan-B merged commit 626a8a1 into ceph:main Jul 30, 2025
@Matan-B Matan-B moved this from Needs QA to Merged (Main) in Crimson Jul 30, 2025
@Matan-B

Matan-B commented Jul 30, 2025

Copy link
Copy Markdown
Contributor

#64715

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged (Pre Umbrella cutoff)

Development

Successfully merging this pull request may close these issues.

5 participants