I/O Performance vs. Cache mode

cbourque

Renowned Member
Oct 12, 2011
11
1
68
Hey guys,

I would like to get your advice on my setup and whether or not I should enable the writeback cache mode considering that I'm planning to run a MariaDB production database inside a KVM virtual machine.

Here's my setup:

CPU: Intel(R) Xeon(R) CPU E5-2650 v3
RAM: 256GB
HDD: 3 x HGST HUC156060CSS200 2.5" 600GB SAS 12Gb/s 15K

The raid controller is the LSI MegaRAID SAS 9271-4i (80 GB CacheCade SSD) configured in RAID 5 with a BBU (writeback). I'm using Proxmox 4.4 and the host and the guests are all using the EXT4 filesystem (3 virtual machines: 1 database + 2 application servers).

I've spent many hours on the Proxmox forum and from I read it should be safe to use writeback nowadays as long as the server is running on an uninterruptible power source and that the raid controller is equipped with a BBU. Is this correct to assume that?

I also did some benchmarks using FIO and the configuration file found on the Proxmox web site (https://pve.proxmox.com/wiki/Iscsi/tests) using iodepth=256 and I was quite surprised to see the big difference in terms of IOPS between the results of the default cache mode and the writeback one!

cache=default
read : io=3279.8MB, bw=31293KB/s, iops=5077, runt=107323msec
write: io=835856KB, bw=7788.3KB/s, iops=1275, runt=107323msec

cache=writeback
read : io=3279.8MB, bw=752004KB/s, iops=122027, runt= 4466msec
write: io=835856KB, bw=187160KB/s, iops=30645, runt= 4466msec

So now my question is the following: would I see a big performance gain by using the writeback cache mode for a database?

All comments and or suggestions would be greatly appreciated!

Thanks,

Christian
 
cache=default it will report to the application OK when all the date are written on the disk(safest)
cache=writeback it will report to the application very fast that the data are written to the disk, but in reality data wil be
written to disk only the sometime in the future, so IOPs is very high, but not safe for the case when power is gone and is no UPS in place.
 
@cbourque:
in your case it should be OK, but also make sure that you use virtio-scsi in your VMs for an extra bit of safety
IIRC with scsi controllers, qemu will try to sync the writecache to the disk whenever a fsync is done inside a Linux VM ( the kernel sends a SYNCHRONIZE_CACHE to the controller when behind requested a fsync, and qemy flushed then the writeback cache)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!