KVM performance tweaks

By applying a few tweaks, you can boost the performance of your VPS.
These tweaks are only required when you do a manual installation. All OS templates have these tweaks build in, so no action is required.

Important tweaks for all Operating Systems:
1) Use the correct disk alignment. We use modern 4K sector drives in all our SATA and SSD VPS nodes. When your partition layout is based on the old MBR 512b sector style, you can loose up to 25 times! of disk I/O performance. That's a huge difference and will result a slow VPS, but also extra I/O load on our VPS nodes. If you partition layout is based on the 4K sector size, your first partition should start at sectory 2048 (or any other value that you can divide by 8).
Modern OSes will take care of this alignment, but CentOS 5 and FreeBSD OSes are known for using a wrong disk alignment - so make sure you partition manually.
More interesting information regarding this can be found on the link below:
http://www.thomas-krenn.com/en/wiki/Partition_Alignment

 

For Linux OSes with the VirtIO disk driver:
echo 0 > /sys/block/vda/queue/rotational
echo 0 > /sys/block/vda/queue/rq_affinity
echo noop > /sys/block/vda/queue/scheduler
echo "echo 0 > /sys/block/vda/queue/rotational" >> /etc/rc.local
echo "echo 0 > /sys/block/vda/queue/rq_affinity" >> /etc/rc.local
echo "echo noop > /sys/block/vda/queue/scheduler" >> /etc/rc.local
echo 'vm.swappiness = 5' >> /etc/sysctl.conf
echo 'vm.vfs_cache_pressure = 50' >> /etc/sysctl.conf

On VPSes with 1GB+ memory, you can consider to set the value "vm.swappiness" to 0 instead of 5. This will lower the swap usage, and thus increases the performance of your VPS.
For increasing sequential read I/O rates, you can add the following to your "/etc/rc.local" file before the "exit 0" line:
blockdev --setra 1024 /dev/vd*

Note; Do no set the value above too high, since that can have negative effect on the overall performance of your VPS

Reboot your VPS afterwards to apply all changes that you've made.

  • 3 gebruikers vonden dit artikel nuttig
Was dit antwoord nuttig?

Gerelateerde artikelen

What hardware specs does the LiteServer VPS platform have?

Hardware specifications vary across our platform and depends on the kind of VPS plan you order,...

How do I use my assigned IPv6 subnet?

    All KVM VPSes will get a /64 or /80 IPv6 subnet assigned.During the installation, one IPv6...

On which location in NL is my VPS being hosted?

By default we host most of our VPSes in our facility located in the city "Dronten" which is in...

Available Operating Systems (ISO / Templates) for KVM and OpenVZ VPSes

Available Operating Systems for KVM and OpenVZ based VPSes.[Last updated on: 13 January 2020]KVM...

My swap memory is missing or incorrect after a (re)install by using a OS template

Unfortunately at some rare moments, we noticed that the swap file isn't setup properly.On most...