Linux – Very slow disk write performance with recent linux kernel in ESXi

linuxvmware-esxi

I have a Linux guest running in VMWare ESXi 6.5U1 which I've recently upgraded from Debian 8 to Debian 9, and disk write speed is now terrible.

The kernel is now 4.9.0-4-686-pae. When tested using
if=/dev/zero bs=16k count=256k of=foo, it measures 14Mb/sec. Real applications are horribly slow and CPU load when writing is high.

If I revert the kernel to the one I used previously, 3.16.0-4-amd64, write performance returns to normal (hundreds of mbit/sec). I didn't make any other change, just selected the old kernel from the grub boot menu.

Following the advice of other questions on serverfault I have set the I/O scheduler to noop, changed the guest hardware configuration to 1 virtual socket with 4 cores (previously the other way around), and changed the disk controller to the VMWare paravirtualized one (previously LSI Logic parallel SCSI), but none of this made any difference.

Read speed seemed unaffected although I haven't measured it explicitly.

How can I fix the performance with the new kernel?

Best Answer

Did you update your initramfs after changing the disk controller? Disk controller modules are loaded early in the boot (in the initramfs phase), so if you did not update your initramfs, it is possible your change did not actually take effect yet.

This command should perform the initramfs update for you:

# update-initramfs -u -k 4.9.0-4-686-pae