Hi there!
I faced a problem with slow disk speed performance inside a VM (when a VM has a disk on host NVMe SSD).
For instance, when I copy 10GB file from one pve to another pve (LAN 10Gbit/s):
pve (host) to VM
Test with fio. Host
VM
The VM config
VM OS details
I have "Proxmox Virtual Environment 7.0-11" on the host.
Disks for VMs provided as LVM.
A part of my /etc/pve/storage.cfg
What can I do to achieve disk speed in a VM like speed on a host?
I faced a problem with slow disk speed performance inside a VM (when a VM has a disk on host NVMe SSD).
For instance, when I copy 10GB file from one pve to another pve (LAN 10Gbit/s):
Bash:
rsync -P -avz file10G 10.1.123.1:
sending incremental file list
file10G
10,737,418,240 100% 2.84GB/s 0:00:03 (xfr#1, to-chk=0/1)
pve (host) to VM
Bash:
rsync -P -avz file10G 10.1.123.206:
sending incremental file list
file10G
617,086,976 5% 196.29MB/s 0:00:50
Test with fio. Host
Code:
fio --name=random-write --ioengine=posixaio --rw=randwrite --bs=4k --numjobs=1 --size=4g --iodepth=1 --runtime=60 --time_based --end_fsync=1
random-write: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=posixaio, iodepth=1
fio-3.25
Starting 1 process
random-write: Laying out IO file (1 file / 4096MiB)
Jobs: 1 (f=1): [w(1)][100.0%][w=445MiB/s][w=114k IOPS][eta 00m:00s]
random-write: (groupid=0, jobs=1): err= 0: pid=4129535: Wed Sep 29 14:37:52 2021
write: IOPS=97.4k, BW=380MiB/s (399MB/s)(22.4GiB/60414msec); 0 zone resets
slat (nsec): min=533, max=1353.4k, avg=1474.47, stdev=821.76
clat (nsec): min=117, max=4367.8k, avg=6619.21, stdev=9392.24
lat (usec): min=4, max=4369, avg= 8.09, stdev= 9.46
clat percentiles (usec):
| 1.00th=[ 6], 5.00th=[ 6], 10.00th=[ 6], 20.00th=[ 6],
| 30.00th=[ 6], 40.00th=[ 6], 50.00th=[ 6], 60.00th=[ 7],
| 70.00th=[ 7], 80.00th=[ 8], 90.00th=[ 8], 95.00th=[ 9],
| 99.00th=[ 14], 99.50th=[ 22], 99.90th=[ 53], 99.95th=[ 75],
| 99.99th=[ 221]
bw ( KiB/s): min=20456, max=506048, per=100.00%, avg=452587.73, stdev=74042.85, samples=103
iops : min= 5114, max=126512, avg=113146.95, stdev=18510.62, samples=103
lat (nsec) : 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.01%
lat (usec) : 2=0.01%, 4=0.01%, 10=97.51%, 20=1.95%, 50=0.42%
lat (usec) : 100=0.08%, 250=0.02%, 500=0.01%, 750=0.01%, 1000=0.01%
lat (msec) : 2=0.01%, 4=0.01%, 10=0.01%
cpu : usr=18.13%, sys=34.95%, ctx=5888188, majf=0, minf=48
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.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.0%, 64=0.0%, >=64=0.0%
issued rwts: total=0,5883316,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
Run status group 0 (all jobs):
WRITE: bw=380MiB/s (399MB/s), 380MiB/s-380MiB/s (399MB/s-399MB/s), io=22.4GiB (24.1GB), run=60414-60414msec
Disk stats (read/write):
dm-6: ios=0/818584, merge=0/0, ticks=0/574964, in_queue=574964, util=14.24%, aggrios=133/944809, aggrmerge=5/2211, aggrticks=29/1313275, aggrin_queue=1347064, aggrutil=70.51%
nvme0n1: ios=133/944809, merge=5/2211, ticks=29/1313275, in_queue=1347064, util=70.51%
VM
Code:
fio --name=random-write --ioengine=posixaio --rw=randwrite --bs=4k --numjobs=1 --size=4g --iodepth=1 --runtime=60 --time_based --end_fsync=1
random-write: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=posixaio, iodepth=1
fio-3.16
Starting 1 process
random-write: Laying out IO file (1 file / 4096MiB)
Jobs: 1 (f=1): [w(1)][100.0%][w=182MiB/s][w=46.7k IOPS][eta 00m:00s]
random-write: (groupid=0, jobs=1): err= 0: pid=2010: Wed Sep 29 12:36:21 2021
write: IOPS=36.9k, BW=144MiB/s (151MB/s)(8775MiB/60803msec); 0 zone resets
slat (nsec): min=506, max=1004.6k, avg=4101.30, stdev=2293.91
clat (nsec): min=166, max=207411k, avg=19751.96, stdev=285681.11
lat (usec): min=6, max=207414, avg=23.85, stdev=285.70
clat percentiles (usec):
| 1.00th=[ 11], 5.00th=[ 14], 10.00th=[ 14], 20.00th=[ 15],
| 30.00th=[ 15], 40.00th=[ 16], 50.00th=[ 17], 60.00th=[ 18],
| 70.00th=[ 19], 80.00th=[ 21], 90.00th=[ 23], 95.00th=[ 27],
| 99.00th=[ 51], 99.50th=[ 65], 99.90th=[ 176], 99.95th=[ 506],
| 99.99th=[ 1319]
bw ( KiB/s): min=17576, max=237512, per=100.00%, avg=158797.04, stdev=32794.76, samples=112
iops : min= 4394, max=59378, avg=39699.25, stdev=8198.70, samples=112
lat (nsec) : 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.01%
lat (usec) : 2=0.01%, 4=0.01%, 10=0.99%, 20=78.22%, 50=19.75%
lat (usec) : 100=0.83%, 250=0.14%, 500=0.02%, 750=0.01%, 1000=0.02%
lat (msec) : 2=0.01%, 4=0.01%, 10=0.01%, 20=0.01%, 50=0.01%
lat (msec) : 100=0.01%, 250=0.01%
cpu : usr=14.97%, sys=36.10%, ctx=2282024, majf=0, minf=58
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.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.0%, 64=0.0%, >=64=0.0%
issued rwts: total=0,2246364,0,1 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
Run status group 0 (all jobs):
WRITE: bw=144MiB/s (151MB/s), 144MiB/s-144MiB/s (151MB/s-151MB/s), io=8775MiB (9201MB), run=60803-60803msec
Disk stats (read/write):
sda: ios=170/415892, merge=32/1899, ticks=32/154140, in_queue=17188, util=9.19%
The VM config
Code:
agent: 1
bios: seabios
boot: c
bootdisk: scsi0
ciuser: ololosha
cores: 2
cpu: host
description: ClickHouse server ch-01
hotplug: network,disk,usb
ide2: NVMe2:vm-115-cloudinit,media=cdrom,size=4M
ipconfig0: ip=10.1.123.206/24,gw=10.1.123.2
kvm: 1
memory: 65536
name: ch-01
net0: virtio=DA:8B:B7:52:AA:A3,bridge=vmbr1
numa: 0
onboot: 1
scsi0: NVMe2:vm-115-disk-0,backup=0,discard=on,iothread=1,size=30G,ssd=1
scsihw: virtio-scsi-single
serial0: socket
smbios1: uuid=c9567916-c96f-47d8-bd77-ae448bb739ec
sockets: 2
VM OS details
Code:
uname -a
Linux ch-01 5.4.0-88-generic #99-Ubuntu SMP Thu Sep 23 17:29:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
dpkg -l | grep qemu
ii qemu-guest-agent 1:4.2-3ubuntu6.17 amd64 Guest-side qemu-system agent
I have "Proxmox Virtual Environment 7.0-11" on the host.
Disks for VMs provided as LVM.
A part of my /etc/pve/storage.cfg
Code:
lvm: NVMe2
vgname VM_disks
content images,rootdir
nodes pve02
shared 0
What can I do to achieve disk speed in a VM like speed on a host?
Last edited: