I have been testing my VM disk performance on an NFS synchronous shared storage. The results have left me scratching my head trying to figure out whats going on. The results may be the expected behavior, but even so I am lost how that may be.
On my NFS synchronous share I created a VM (Linux Mint) and attached several disks in both QCOW2 format and RAW. I noticed some massive difference in performance based upon the file-system (EXT4 and XFS) of those disks. This lead me to believe the cache mode of the disks were hitting the SLOG/ZIL on my zpool differently so I began to investigate my zpool arc summary.
In answering my first suspicion, XFS out preforms EXT4 regardless of the test results that follow; but other questions linger.
My zpool sync setting on storage/dataset of SAN/NAS for all disks that are tested:
My zpool ZIL summary before No-Cache tests:
My VM disks:
1) scsi0: Linux OS disk; QCOW2; EXT4 formatted
2) scsi1: QCOW2; EXT4 formatted
3) scsi2: RAW; EXT4 formatted
4) scsi3: QCOW; XFS formatted
5) scsi4: RAW; XFS formatted
My test results, first where all disk caches set to "No Cache":
My zpool ZIL summary prior to Write-back tests:
Second tests where all disk caches set to "Write-back":
Conclusion:
1) Disk cache mode in PVE GUI are ignored on NFS synchronous shares.
2) QCOW2 disks do NOT commit to ZIL on NFS synchronous shares (regardless of disk cache mode)
3) RAW disks DO commit to ZIL on NFS synchronous shares (regardless of disk cache mode)
Questions:
1) Is this the expected behavior?
2) Are QCOW2 disks write-cache always write-through on NFS sync shares?
3) RAW disks write-cache always write-back on NFS sync shares?
4) Possible to set write-back on QCOW2 disks?
My understanding (which I could be wrong) is an SLOG/ZIL attached zpool where sync=always is that write-through should hit the ZIL but the VM will wait for the ZIL to flush to disk. Whereas write-back will commit to ZIL and inform the VM that the write operation is completed before flushing to disk.
If this is correct, it would seem somehow QCOW2 disks are behaving as async even when stored on a synchronous NFS mounted share. Additionally, the QCOW2 disk is at the same time behaving as though the zpool is in sync=disabled mode and not hitting the ZIL whatsoever... Whereas, RAW disks are behaving normally on the same storage.
On my NFS synchronous share I created a VM (Linux Mint) and attached several disks in both QCOW2 format and RAW. I noticed some massive difference in performance based upon the file-system (EXT4 and XFS) of those disks. This lead me to believe the cache mode of the disks were hitting the SLOG/ZIL on my zpool differently so I began to investigate my zpool arc summary.
In answering my first suspicion, XFS out preforms EXT4 regardless of the test results that follow; but other questions linger.
My zpool sync setting on storage/dataset of SAN/NAS for all disks that are tested:
Code:
root@pvesan:/# zfs get sync raid50vol/pve/nfs-storage
NAME PROPERTY VALUE SOURCE
raid50vol/pve/nfs-storage sync always local
My zpool ZIL summary before No-Cache tests:
Code:
ZIL committed transactions: 4.4M
Commit requests: 3.2M
Flushes to stable storage: 2.7M
Transactions to SLOG storage pool: 113.1 GiB 2.4M
Transactions to non-SLOG storage pool: 232 Bytes 1
My VM disks:
1) scsi0: Linux OS disk; QCOW2; EXT4 formatted
2) scsi1: QCOW2; EXT4 formatted
3) scsi2: RAW; EXT4 formatted
4) scsi3: QCOW; XFS formatted
5) scsi4: RAW; XFS formatted
My test results, first where all disk caches set to "No Cache":
Code:
> EXT4 QCOW2 Linux Mint Guest root (scsi0) disk:
root@nfs-linuxmint:/home/republicus# sync; dd if=/dev/zero of=tempfile bs=1M count=4096; sync
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 5.94764 s, 722 MB/s
ZIL committed transactions: 4.4M
Commit requests: 3.2M
Flushes to stable storage: 2.7M
Transactions to SLOG storage pool: 113.1 GiB 2.4M
Transactions to non-SLOG storage pool: 232 Bytes 1
> EXT4 QCOW2 (scsi1) disk:
root@nfs-linuxmint:/mnt/republicus/EXT4-QCOW# sync; dd if=/dev/zero of=tempfile bs=1M count=4096; sync
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 5.53517 s, 776 MB/s
ZIL committed transactions: 4.4M
Commit requests: 3.2M
Flushes to stable storage: 2.7M
Transactions to SLOG storage pool: 113.1 GiB 2.4M
Transactions to non-SLOG storage pool: 232 Bytes 1
> EXT4 RAW (scsi2) disk:
root@nfs-linuxmint:/mnt/republicus/EXT4-RAW# sync; dd if=/dev/zero of=tempfile bs=1M count=4096; sync
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 6.98988 s, 614 MB/s
ZIL committed transactions: 4.5M
Commit requests: 3.3M
Flushes to stable storage: 2.8M
Transactions to SLOG storage pool: 117.1 GiB 2.4M
Transactions to non-SLOG storage pool: 232 Bytes 1
> XFS QCOW (scsi3) disk:
root@nfs-linuxmint:/mnt/republicus/XFS-QCOW# sync; dd if=/dev/zero of=tempfile bs=1M count=4096; sync
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 3.06323 s, 1.4 GB/s
ZIL committed transactions: 4.5M
Commit requests: 3.3M
Flushes to stable storage: 2.8M
Transactions to SLOG storage pool: 117.1 GiB 2.5M
Transactions to non-SLOG storage pool: 232 Bytes 1
> XFS-RAW (scsi4) disk:
root@nfs-linuxmint:/mnt/republicus/XFS-RAW# sync; dd if=/dev/zero of=tempfile bs=1M count=4096; sync
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 3.88909 s, 1.1 GB/s
ZIL committed transactions: 4.6M
Commit requests: 3.3M
Flushes to stable storage: 2.8M
Transactions to SLOG storage pool: 121.1 GiB 2.5M
Transactions to non-SLOG storage pool: 232 Bytes 1
My zpool ZIL summary prior to Write-back tests:
Code:
ZIL committed transactions: 4.6M
Commit requests: 3.4M
Flushes to stable storage: 2.9M
Transactions to SLOG storage pool: 121.2 GiB 2.5M
Transactions to non-SLOG storage pool: 232 Bytes 1
Second tests where all disk caches set to "Write-back":
Code:
> EXT4 QCOW2 Linux Mint Guest root (scsi0) disk:
root@nfs-linuxmint:/home/republicus# sync; dd if=/dev/zero of=tempfile bs=1M count=4096; sync
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 5.91078 s, 727 MB/s
ZIL committed transactions: 4.6M
Commit requests: 3.4M
Flushes to stable storage: 2.9M
Transactions to SLOG storage pool: 121.2 GiB 2.5M
Transactions to non-SLOG storage pool: 232 Bytes 1
> EXT4 QCOW2 (scsi1) disk:
root@nfs-linuxmint:/mnt/republicus/EXT4-QCOW# sync; dd if=/dev/zero of=tempfile bs=1M count=4096; sync
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 5.7421 s, 748 MB/s
ZIL committed transactions: 4.6M
Commit requests: 3.4M
Flushes to stable storage: 2.9M
Transactions to SLOG storage pool: 121.2 GiB 2.5M
Transactions to non-SLOG storage pool: 232 Bytes 1
> EXT4 RAW (scsi2) disk:
root@nfs-linuxmint:/mnt/republicus/EXT4-RAW# sync; dd if=/dev/zero of=tempfile bs=1M count=4096; sync
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 6.47143 s, 664 MB/s
ZIL committed transactions: 4.7M
Commit requests: 3.4M
Flushes to stable storage: 2.9M
Transactions to SLOG storage pool: 125.2 GiB 2.5M
Transactions to non-SLOG storage pool: 232 Bytes 1
> XFS QCOW (scsi3) disk:
root@nfs-linuxmint:/mnt/republicus/XFS-QCOW# sync; dd if=/dev/zero of=tempfile bs=1M count=4096; sync
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 3.34364 s, 1.3 GB/s
ZIL committed transactions: 4.7M
Commit requests: 3.4M
Flushes to stable storage: 2.9M
Transactions to SLOG storage pool: 125.2 GiB 2.5M
Transactions to non-SLOG storage pool: 232 Bytes 1
> XFS-RAW (scsi4) disk:
root@nfs-linuxmint:/mnt/republicus/XFS-RAW# sync; dd if=/dev/zero of=tempfile bs=1M count=4096; sync
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 4.34982 s, 987 MB/s
ZIL committed transactions: 4.8M
Commit requests: 3.5M
Flushes to stable storage: 3.0M
Transactions to SLOG storage pool: 129.2 GiB 2.6M
Transactions to non-SLOG storage pool: 232 Bytes 1
Conclusion:
1) Disk cache mode in PVE GUI are ignored on NFS synchronous shares.
2) QCOW2 disks do NOT commit to ZIL on NFS synchronous shares (regardless of disk cache mode)
3) RAW disks DO commit to ZIL on NFS synchronous shares (regardless of disk cache mode)
Questions:
1) Is this the expected behavior?
2) Are QCOW2 disks write-cache always write-through on NFS sync shares?
3) RAW disks write-cache always write-back on NFS sync shares?
4) Possible to set write-back on QCOW2 disks?
My understanding (which I could be wrong) is an SLOG/ZIL attached zpool where sync=always is that write-through should hit the ZIL but the VM will wait for the ZIL to flush to disk. Whereas write-back will commit to ZIL and inform the VM that the write operation is completed before flushing to disk.
If this is correct, it would seem somehow QCOW2 disks are behaving as async even when stored on a synchronous NFS mounted share. Additionally, the QCOW2 disk is at the same time behaving as though the zpool is in sync=disabled mode and not hitting the ZIL whatsoever... Whereas, RAW disks are behaving normally on the same storage.
Last edited: