KVM Bad disk performance

General support questions
henriqueps
Posts: 9
Joined: 2017/02/13 13:00:11

Re: KVM Bad disk performance

Post by henriqueps » 2017/02/27 15:29:34

cgokan wrote:KVM is not Windows performance. It would be better if you use an SSD disk. It is best to use Linux as much as possible.
cgokan,
There is no way to improve disk performance?
I still kept searching about how I could improve kvm performance, and I've just found some tests using VHOST_NET and VHOST_BLK.
Do you think, these parameters could help?

drk
Posts: 405
Joined: 2014/01/30 20:38:28

Re: KVM Bad disk performance

Post by drk » 2017/03/01 07:58:15

What IO scheduler are you using on the CentOS7 host?

henriqueps
Posts: 9
Joined: 2017/02/13 13:00:11

Re: KVM Bad disk performance

Post by henriqueps » 2017/03/01 14:38:26

drk wrote:What IO scheduler are you using on the CentOS7 host?
Deadline

drk
Posts: 405
Joined: 2014/01/30 20:38:28

Re: KVM Bad disk performance

Post by drk » 2017/03/02 03:26:36

Guest memory allocation and vcpu allocation?

I have gotten near bare metal speed on random i/o using lvm backed CentOS guests but have not had the, er, pleasure of trying Windows guests.

henriqueps
Posts: 9
Joined: 2017/02/13 13:00:11

Re: KVM Bad disk performance

Post by henriqueps » 2017/03/07 14:29:45

drk wrote:Guest memory allocation and vcpu allocation?

I have gotten near bare metal speed on random i/o using lvm backed CentOS guests but have not had the, er, pleasure of trying Windows guests.
27GB of ram and 6vpu.
I've left 5GB of ram and 2vcpu for the host.

drk
Posts: 405
Joined: 2014/01/30 20:38:28

Re: KVM Bad disk performance

Post by drk » 2017/03/10 06:37:15

Those disks aren't doing 512e are they? The partitions are aligned etc?

henriqueps
Posts: 9
Joined: 2017/02/13 13:00:11

Re: KVM Bad disk performance

Post by henriqueps » 2017/03/16 12:47:27

drk wrote:Those disks aren't doing 512e are they? The partitions are aligned etc?
Sorry, but how can I check this?

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: KVM Bad disk performance

Post by TrevorH » 2017/03/16 17:49:58

Start by running e.g fdisk -lu /dev/sda on each drive. The output should say something like

Code: Select all

Disk /dev/sda: 480.1 GB, 480103981056 bytes, 937703088 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      821247      409600   83  Linux
/dev/sda2          821248   937703087   468440920   83  Linux
If it says that it has physical sectors of 4096 byets then your partitions all need to start on a byte boundary that's exactly divisible by 4096. In my example there you can see sda1 starts on sector 2048 and since each sector is "512 bytes" according to the Units line, that would be on byte 2048*512=1048576 and 1048576/4096=256 which is a whole integer so the partition is aligned correctly.

This alignment check needs to be true for all the various layers in the system. So, if you use LVM then your LVs also need to be correctly aligned within the partitions that make up the PVs. If you are using LVs to attach to your VMs then they too need to start their partitions on 4096 byte boundaries.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

MrCalvin
Posts: 6
Joined: 2018/03/13 23:29:13

Re: KVM Bad disk performance

Post by MrCalvin » 2021/04/10 18:24:14

If I have a disk with true 4K sectors then it should be fine to set the start-sector at 256 (which will also be 1MB), right?

Disk model: ST2000NM0105-1YY
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 9B704E0A-7EFB-48F3-9A32-3C4C6D763623

Post Reply