I have a zfs pool containing of 4 x 750GB "enterprise" sata drives. On the host and in containers I get fairly good disk speeds, however in a KVM guest the disk speeds fall on their face. I've tried various KVM disk cache settings including no cache, write back, write through and nothing seems to fix the disk speed issue.
If I spin up a container, I get very close to host disk speeds.
Host:
root@pve:/home/curt# dd if=/dev/zero of=speedtest bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.125674 s, 834 MB/s
root@pve:/home/curt# dd if=/dev/zero of=speedtest bs=1M count=100 conv=fdatasync
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.161026 s, 651 MB/s
root@pve:/home/curt# dd if=/dev/zero of=speedtest bs=64k count=3200 conv=fdatasync
3200+0 records in
3200+0 records out
209715200 bytes (210 MB, 200 MiB) copied, 0.409027 s, 513 MB/s
KVM guest:
root@slowkvm:~# dd if=/dev/zero of=speedtest bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.988097 s, 106 MB/s
root@slowkvm:~# dd if=/dev/zero of=speedtest bs=1M count=100 conv=fdatasync
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 1.6643 s, 63.0 MB/s
root@slowkvm:~# dd if=/dev/zero of=speedtest bs=64k count=3200 conv=fdatasync
3200+0 records in
3200+0 records out
209715200 bytes (210 MB, 200 MiB) copied, 3.32568 s, 63.1 MB/s
If I spin up a container, I get very close to host disk speeds.
Host:
root@pve:/home/curt# dd if=/dev/zero of=speedtest bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.125674 s, 834 MB/s
root@pve:/home/curt# dd if=/dev/zero of=speedtest bs=1M count=100 conv=fdatasync
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.161026 s, 651 MB/s
root@pve:/home/curt# dd if=/dev/zero of=speedtest bs=64k count=3200 conv=fdatasync
3200+0 records in
3200+0 records out
209715200 bytes (210 MB, 200 MiB) copied, 0.409027 s, 513 MB/s
KVM guest:
root@slowkvm:~# dd if=/dev/zero of=speedtest bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.988097 s, 106 MB/s
root@slowkvm:~# dd if=/dev/zero of=speedtest bs=1M count=100 conv=fdatasync
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 1.6643 s, 63.0 MB/s
root@slowkvm:~# dd if=/dev/zero of=speedtest bs=64k count=3200 conv=fdatasync
3200+0 records in
3200+0 records out
209715200 bytes (210 MB, 200 MiB) copied, 3.32568 s, 63.1 MB/s