Hello,
I’d like to ask some questions regarding the innodb_io_capacity value.
I don’t know much about DBs and storage in general (the aftermentioned benchmark’s config has been built using AI help), but its default value of 200 is apparently very small for our use cases.
This said, the official documentation recommends a value of 4000, while MariaDB’s suggests to “be set to around the number of I/O operations per second that system can handle, based on the type of drive/s being used.”.
Also, the Device-Specific Recommendations section on the “InnoDB Page Flushing” page, lists a table in which the value “may be as high as 80,000.” (in NVMe storage).
Nextcloud’s own docs do, indeed, reflect the range of SATA SSDs, although it is unexplained why this value has been chosen.
I have managed to run a benchmark on my own NVMe SSD with the following results:
fio --name=test \
--rw=randrw \
--size=6G \
--bs=16k \
--filename=/tmp/fio.test \
--direct=1 \
--ioengine=libaio \
--ramp_time=4 \
--iodepth=32 \
--runtime=30 \
--time_based \
--group_reporting
test: (g=0): rw=randrw, bs=(R) 16.0KiB-16.0KiB, (W) 16.0KiB-16.0KiB, (T) 16.0KiB-16.0KiB, ioengine=libaio, iodepth=32
fio-3.39
Starting 1 process
test: Laying out IO file (1 file / 6144MiB)
Jobs: 1 (f=1): [m(1)][100.0%][r=1527MiB/s,w=1515MiB/s][r=97.7k,w=96.9k IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=21602: Wed Jul 1 18:03:06 2026
read: IOPS=96.8k, BW=1512MiB/s (1586MB/s)(44.3GiB/30001msec)
slat (nsec): min=2270, max=62271, avg=4079.63, stdev=859.34
clat (nsec): min=1910, max=1060.7k, avg=160360.95, stdev=13672.94
lat (usec): min=7, max=1088, avg=164.44, stdev=14.06
clat percentiles (usec):
| 1.00th=[ 145], 5.00th=[ 149], 10.00th=[ 151], 20.00th=[ 155],
| 30.00th=[ 157], 40.00th=[ 159], 50.00th=[ 159], 60.00th=[ 161],
| 70.00th=[ 163], 80.00th=[ 165], 90.00th=[ 169], 95.00th=[ 172],
| 99.00th=[ 182], 99.50th=[ 204], 99.90th=[ 347], 99.95th=[ 355],
| 99.99th=[ 388]
bw ( MiB/s): min= 1235, max= 1546, per=100.00%, avg=1512.75, stdev=41.77, samples=60
iops : min=79066, max=98958, avg=96816.02, stdev=2673.13, samples=60
write: IOPS=96.7k, BW=1512MiB/s (1585MB/s)(44.3GiB/30001msec); 0 zone resets
slat (nsec): min=2860, max=77581, avg=4496.77, stdev=952.15
clat (usec): min=13, max=1059, avg=161.13, stdev=13.83
lat (usec): min=18, max=1089, avg=165.63, stdev=14.22
clat percentiles (usec):
| 1.00th=[ 147], 5.00th=[ 151], 10.00th=[ 153], 20.00th=[ 155],
| 30.00th=[ 157], 40.00th=[ 159], 50.00th=[ 161], 60.00th=[ 161],
| 70.00th=[ 163], 80.00th=[ 165], 90.00th=[ 169], 95.00th=[ 172],
| 99.00th=[ 184], 99.50th=[ 206], 99.90th=[ 347], 99.95th=[ 359],
| 99.99th=[ 392]
bw ( MiB/s): min= 1237, max= 1536, per=100.00%, avg=1511.86, stdev=41.58, samples=60
iops : min=79190, max=98336, avg=96759.23, stdev=2660.84, samples=60
lat (usec) : 2=0.01%, 10=0.01%, 20=0.01%, 50=0.01%, 100=0.01%
lat (usec) : 250=99.62%, 500=0.38%, 750=0.01%, 1000=0.01%
lat (msec) : 2=0.01%
cpu : usr=14.40%, sys=85.60%, ctx=26, majf=0, minf=37
IO depths : 1=0.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=100.0%, >=64=0.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.1%, 64=0.0%, >=64=0.0%
issued rwts: total=2903909,2902213,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=32
Run status group 0 (all jobs):
READ: bw=1512MiB/s (1586MB/s), 1512MiB/s-1512MiB/s (1586MB/s-1586MB/s), io=44.3GiB (47.6GB), run=30001-30001msec
WRITE: bw=1512MiB/s (1585MB/s), 1512MiB/s-1512MiB/s (1585MB/s-1585MB/s), io=44.3GiB (47.6GB), run=30001-30001msec
which gives me around 95k IOPS with 16 KB block size; does it mean that innodb_io_capacity should be set higher than my current 20000? Keeping in mind that, unless set, innodb_io_capacity_max is double the normal value, by default.
I only run a single user (so far, me), although I have often found slow-downs with huge file counts (I keep Git repos too), and that is one of my priorities. I guess 20 k are enough, what’s your thought on this?