Доброго времени суток! Столкнулся со странным поведением связки 1С + PostgreSQL (для 1С от PostgresPRO).
Имеется комп: Asus ROG Strix B550F + Ryzen 5900X + 128Gb 3600MHz. Установлены SATA Crucial BX500 240Gb и NVME Samsung 970 PRO. SATA в качестве системного (создан рейд1 на основе одного диска, в будущем будет подключен второй), NVME под базы 1С. Использую тест Гилева. Так вот, если база находится на sata диске, то получаю большее количество попугаев, чем с nvme диска. Для меня это парадокс и не знаю куда копать. Сделал замеры дисков с помощью fio, результаты следующие:
Для начала
user@ubuntu1c:~/scripts$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
user@ubuntu1c:~/scripts$ uname -a
Linux ubuntu1c 5.18.3-051803-generic #202206090934 SMP PREEMPT_DYNAMIC Thu Jun 9 09:40:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
NVME
user@ubuntu1c:/var/lib/pgpro$ sudo fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=fiotest --filename=testfio --bs=4k --iodepth=64 --size=8G --readwrite=randrw --rwmixread=75
fiotest: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=64
fio-3.16
Starting 1 process
fiotest: Laying out IO file (1 file / 8192MiB)
Jobs: 1 (f=1): [m(1)][100.0%][r=920MiB/s,w=308MiB/s][r=235k,w=78.8k IOPS][eta 00m:00s]
fiotest: (groupid=0, jobs=1): err= 0: pid=10425: Thu Jun 16 16:54:06 2022
read: IOPS=235k, BW=918MiB/s (962MB/s)(6141MiB/6692msec)
bw ( KiB/s): min=918000, max=955656, per=100.00%, avg=939853.54, stdev=11522.55, samples=13
iops : min=229500, max=238914, avg=234963.38, stdev=2880.64, samples=13
write: IOPS=78.5k, BW=306MiB/s (321MB/s)(2051MiB/6692msec); 0 zone resets
bw ( KiB/s): min=305784, max=319920, per=100.00%, avg=313875.69, stdev=4207.63, samples=13
iops : min=76446, max=79980, avg=78468.92, stdev=1051.91, samples=13
cpu : usr=15.29%, sys=66.25%, ctx=517738, majf=0, minf=9
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=1572145,525007,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=918MiB/s (962MB/s), 918MiB/s-918MiB/s (962MB/s-962MB/s), io=6141MiB (6440MB), run=6692-6692msec
WRITE: bw=306MiB/s (321MB/s), 306MiB/s-306MiB/s (321MB/s-321MB/s), io=2051MiB (2150MB), run=6692-6692msec
Disk stats (read/write):
nvme0n1: ios=1517950/506938, merge=0/1, ticks=301712/4067, in_queue=305782, util=98.55%
SATA
user@ubuntu1c:~$ sudo fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=fiotest --filename=testfio --bs=4k --iodepth=64 --size=8G --readwrite=randrw --rwmixread=75
fiotest: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=64
fio-3.16
Starting 1 process
fiotest: Laying out IO file (1 file / 8192MiB)
Jobs: 1 (f=1): [m(1)][100.0%][r=84.9MiB/s,w=28.6MiB/s][r=21.7k,w=7309 IOPS][eta 00m:00s]
fiotest: (groupid=0, jobs=1): err= 0: pid=10863: Thu Jun 16 16:58:07 2022
read: IOPS=10.6k, BW=41.4MiB/s (43.4MB/s)(6141MiB/148226msec)
bw ( KiB/s): min= 7, max=98784, per=99.81%, avg=42342.31, stdev=43223.89, samples=296
iops : min= 1, max=24696, avg=10585.49, stdev=10806.03, samples=296
write: IOPS=3541, BW=13.8MiB/s (14.5MB/s)(2051MiB/148226msec); 0 zone resets
bw ( KiB/s): min= 8, max=32968, per=100.00%, avg=14236.47, stdev=14441.81, samples=294
iops : min= 2, max= 8242, avg=3559.02, stdev=3610.52, samples=294
cpu : usr=0.96%, sys=4.47%, ctx=1196316, majf=0, minf=9
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=1572145,525007,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=41.4MiB/s (43.4MB/s), 41.4MiB/s-41.4MiB/s (43.4MB/s-43.4MB/s), io=6141MiB (6440MB), run=148226-148226msec
WRITE: bw=13.8MiB/s (14.5MB/s), 13.8MiB/s-13.8MiB/s (14.5MB/s-14.5MB/s), io=2051MiB (2150MB), run=148226-148226msec
Disk stats (read/write):
md127: ios=1567385/523634, merge=0/0, ticks=4207484/1318636, in_queue=5526120, util=94.52%, aggrios=1570335/524971, aggrmerge=1810/280, aggrticks=4214018/1227225, aggrin_queue=5443023, aggrutil=94.71%
Как можно увидеть показатели nvme выше чем у sata (остальные тесты пока не стал делать). Из-за чего такая разница в производительности PostgreSQL может наблюдаться? Базы подменяю обычным монтированием/отмонтированием диска nvme от папки /var/lib/pgpro.