Project

General

Profile

Actions

Bug #75190

open
MA MA

Leverage create_scheduling_group to implement QoS in Crimson

Bug #75190: Leverage create_scheduling_group to implement QoS in Crimson

Added by MOHIT AGRAWAL 9 months ago. Updated 8 months ago.

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

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

Currently we are using mClock at the classic OSD level to implement QoS but it has not yet been implemented at the
per pool level. In crimson we are using this only for recovery operations, we can use it for other osd operations also
and it is slightly complex to implement it. It seems that the Seastar approach has less overhead compared to mClock and we can use it to apply QoS at the individual pool level as well.

MA Updated by MOHIT AGRAWAL 9 months ago Actions #2

  • Pull request ID set to 67874

I executed multiple test cases to validate QoS behavior. By default, the option crimson_enable_scheduling_groups is disabled.

I used a script that generates load for 5 iterations and computes the average across all runs.
The script executes the following command to generate the load:


fio -ioengine=rados -conf=/mnt/moagrawa/ceph_upstream/ceph/build/ceph.conf -pool=test  -rw=randwrite -bs=128k -numjobs=8 -iodepth=64 --size=6400M -nrfiles=50000 -alloc-size=1024m -direct=1 -time_based -runtime=300 -group_reporting -output-format=json -name=fio_test

Without scheduling groups (default)
crimson_128_pg_16_core_8_conc
   BW: 2963.40 MiB/s
   IOPS: 23707
   Avg clat: 21.54 ms
   Avg 99th latency: 354.42 ms

With default scheduling group enabled
crimson_128_pg_16_core_8_conc_schd_group
 FINAL AVG for randwrite:
   BW: 3279.64 MiB/s
   IOPS: 26237
   Avg clat: 19.47 ms
   Avg 99th latency: 243.06 ms

After configuring bandwidth limit (2097152000)
 ./bin/ceph config set osd crimson_sg_client_bandwidth 2097152000
crimson_128_pg_16_core_8_conc_schd_group_bw
 FINAL AVG for randwrite:
   BW: 1929.12 MiB/s
   IOPS: 15433
   Avg clat: 33.10 ms
   Avg 99th latency: 164.63 ms


As we can see after configure bw it respects the value.

MA Updated by MOHIT AGRAWAL 8 months ago Actions #3

After configuring the same bandwidth limit (2097152000) for the client_scheduling_group with default CPU Shares as shown below:

 ceph config set osd crimson_sg_client_bandwidth 2097152000

we executed four fio clients simultaneously using the following workload:

fio -ioengine=rados -conf=/mnt/moagrawa/ceph_upstream/ceph/build/ceph.conf -pool=test -rw=randwrite -bs=128k -numjobs=8 -iodepth=64 --size=6400M -nrfiles=50000 -alloc-size=1024m -direct=1 -time_based -runtime=300 -group_reporting -output-format=json -name=fio_client_<1-4>

Baseline (without scheduling group and bandwidth limit)
The following results were observed when no scheduling group or bandwidth limit was configured:

client_1
Testing: randwrite
  BW=1053.77 MiB/s | IOPS=8430 | Avg clat=60.63 ms | 99th=1098.91 ms | Cycles=8660760690685 | CPI=1.85 | Cycles/IO=3419670
  BW=2544.81 MiB/s | IOPS=20358 | Avg clat=25.09 ms | 99th=868.22 ms | Cycles=7821389542872 | CPI=1.79 | Cycles/IO=1279990
  BW=3011.47 MiB/s | IOPS=24092 | Avg clat=21.20 ms | 99th=175.11 ms | Cycles=9829209986782 | CPI=1.86 | Cycles/IO=1359750
  BW=2940.28 MiB/s | IOPS=23522 | Avg clat=21.71 ms | 99th=170.92 ms | Cycles=9154023844222 | CPI=1.82 | Cycles/IO=1296950
  BW=2963.17 MiB/s | IOPS=23705 | Avg clat=21.54 ms | 99th=143.65 ms | Cycles=9273775478433 | CPI=1.83 | Cycles/IO=1303890

client_2
Testing: randwrite
  BW=1229.78 MiB/s | IOPS=9838 | Avg clat=51.93 ms | 99th=994.05 ms | Cycles=8660761104461 | CPI=1.85 | Cycles/IO=2918910
  BW=2821.65 MiB/s | IOPS=22573 | Avg clat=22.63 ms | 99th=442.50 ms | Cycles=9553879958773 | CPI=1.90 | Cycles/IO=1410060
  BW=3183.58 MiB/s | IOPS=25469 | Avg clat=20.05 ms | 99th=333.45 ms | Cycles=14485854660044 | CPI=2.00 | Cycles/IO=1895160
  BW=1792.33 MiB/s | IOPS=14339 | Avg clat=35.63 ms | 99th=641.73 ms | Cycles=13541084011052 | CPI=1.88 | Cycles/IO=3142230
  BW=2674.93 MiB/s | IOPS=21399 | Avg clat=23.85 ms | 99th=265.29 ms | Cycles=14361245772317 | CPI=1.98 | Cycles/IO=2229580

client_3
Testing: randwrite
  BW=1072.96 MiB/s | IOPS=8584 | Avg clat=59.53 ms | 99th=1082.13 ms | Cycles=8660610294527 | CPI=1.85 | Cycles/IO=3348870
  BW=2529.30 MiB/s | IOPS=20234 | Avg clat=25.25 ms | 99th=413.14 ms | Cycles=8683263595095 | CPI=1.86 | Cycles/IO=1429660
  BW=2819.82 MiB/s | IOPS=22559 | Avg clat=22.64 ms | 99th=392.17 ms | Cycles=13414814934200 | CPI=1.91 | Cycles/IO=1981160
  BW=1856.52 MiB/s | IOPS=14852 | Avg clat=34.40 ms | 99th=616.56 ms | Cycles=14693947387334 | CPI=2.02 | Cycles/IO=3296000
  BW=2503.92 MiB/s | IOPS=20031 | Avg clat=25.49 ms | 99th=434.11 ms | Cycles=14605163530196 | CPI=2.00 | Cycles/IO=2428930

client_4
Testing: randwrite
  BW=1179.52 MiB/s | IOPS=9436 | Avg clat=54.18 ms | 99th=1082.13 ms | Cycles=8660611143149 | CPI=1.85 | Cycles/IO=3058060
  BW=3130.01 MiB/s | IOPS=25040 | Avg clat=20.39 ms | 99th=204.47 ms | Cycles=8019099451384 | CPI=1.80 | Cycles/IO=1067220
  BW=2555.68 MiB/s | IOPS=20445 | Avg clat=24.99 ms | 99th=583.01 ms | Cycles=12809090516581 | CPI=1.90 | Cycles/IO=2087130
  BW=2821.43 MiB/s | IOPS=22571 | Avg clat=22.63 ms | 99th=467.66 ms | Cycles=13819627520269 | CPI=1.88 | Cycles/IO=2039800
  BW=2765.44 MiB/s | IOPS=22124 | Avg clat=23.09 ms | 99th=392.17 ms | Cycles=14218135803571 | CPI=2.00 | Cycles/IO=2141120

With scheduling group and bandwidth limit
After enabling the scheduling group and applying the bandwidth limit, the following results were observed:

client_1
Testing: randwrite
  BW=1003.68 MiB/s | IOPS=8029 | Avg clat=63.65 ms | 99th=417.33 ms | Cycles=8315776526313 | CPI=1.79 | Cycles/IO=3451230
  BW=1944.69 MiB/s | IOPS=15557 | Avg clat=32.84 ms | 99th=283.12 ms | Cycles=9653502427481 | CPI=1.79 | Cycles/IO=2067940
  BW=1943.39 MiB/s | IOPS=15547 | Avg clat=32.86 ms | 99th=492.83 ms | Cycles=9564503831944 | CPI=1.77 | Cycles/IO=2050020
  BW=1946.95 MiB/s | IOPS=15576 | Avg clat=32.80 ms | 99th=417.33 ms | Cycles=11762779592561 | CPI=1.80 | Cycles/IO=2516950
  BW=1947.60 MiB/s | IOPS=15581 | Avg clat=32.78 ms | 99th=238.03 ms | Cycles=11818776999662 | CPI=1.80 | Cycles/IO=2527990
client_2
Testing: randwrite
  BW=1005.82 MiB/s | IOPS=8047 | Avg clat=63.50 ms | 99th=425.72 ms | Cycles=8316531216532 | CPI=1.79 | Cycles/IO=3441170
  BW=1946.11 MiB/s | IOPS=15569 | Avg clat=32.81 ms | 99th=198.18 ms | Cycles=9456760009732 | CPI=1.79 | Cycles/IO=2024470
  BW=1946.23 MiB/s | IOPS=15570 | Avg clat=32.81 ms | 99th=214.96 ms | Cycles=14016083359214 | CPI=1.85 | Cycles/IO=3000360
  BW=1947.55 MiB/s | IOPS=15580 | Avg clat=32.79 ms | 99th=250.61 ms | Cycles=11617879010325 | CPI=1.83 | Cycles/IO=2485110
  BW=1946.14 MiB/s | IOPS=15569 | Avg clat=32.81 ms | 99th=337.64 ms | Cycles=14079241596534 | CPI=1.85 | Cycles/IO=3013360
client_3
Testing: randwrite
  BW=1336.44 MiB/s | IOPS=10692 | Avg clat=47.79 ms | 99th=429.92 ms | Cycles=8317087554123 | CPI=1.79 | Cycles/IO=2592000
  BW=1946.78 MiB/s | IOPS=15574 | Avg clat=32.80 ms | 99th=179.31 ms | Cycles=12793708173291 | CPI=1.93 | Cycles/IO=2737940
  BW=1944.41 MiB/s | IOPS=15555 | Avg clat=32.84 ms | 99th=367.00 ms | Cycles=13595978226523 | CPI=1.85 | Cycles/IO=2912890
  BW=1946.47 MiB/s | IOPS=15572 | Avg clat=32.80 ms | 99th=329.25 ms | Cycles=13656567462517 | CPI=1.81 | Cycles/IO=2922480
  BW=1946.80 MiB/s | IOPS=15574 | Avg clat=32.80 ms | 99th=371.20 ms | Cycles=13031265348971 | CPI=1.80 | Cycles/IO=2788210
client_4
Testing: randwrite
  BW=1324.06 MiB/s | IOPS=10592 | Avg clat=48.24 ms | 99th=509.61 ms | Cycles=8315184384640 | CPI=1.79 | Cycles/IO=2610010
  BW=1943.46 MiB/s | IOPS=15548 | Avg clat=32.85 ms | 99th=467.66 ms | Cycles=12487733950180 | CPI=1.88 | Cycles/IO=2676790
  BW=1944.95 MiB/s | IOPS=15560 | Avg clat=32.84 ms | 99th=333.45 ms | Cycles=13483110855671 | CPI=1.84 | Cycles/IO=2887800
  BW=1946.02 MiB/s | IOPS=15568 | Avg clat=32.81 ms | 99th=219.15 ms | Cycles=13627937968781 | CPI=1.83 | Cycles/IO=2917320
  BW=1946.21 MiB/s | IOPS=15570 | Avg clat=32.81 ms | 99th=346.03 ms | Cycles=11967453775188 | CPI=1.79 | Cycles/IO=2561190  

As we can see the client_scheduling_group bandwidth limit effectively enforces per-client QoS, ensuring fair
and predictable resource distribution under contention.
Actions

Also available in: PDF Atom