I have Ubuntu 12.04 (x86) running under VMware Workstation 10.0.5 on a Windows 7 x64 host. Disk access in this VM is noticeably slow - it takes ages just to start Firefox, for example, and the disk light is on the whole time. hdparm -tT
confirms this:
/dev/sda:
Timing cached reads: 18100 MB in 1.99 seconds = 9073.75 MB/sec
Timing buffered disk reads: 42 MB in 3.54 seconds = 11.85 MB/sec
However, I have 2 other VMs on the same host partition (Ubuntu 11.04 and 14.04) and they're both OK:
/dev/sda:
Timing cached reads: 17388 MB in 2.00 seconds = 8703.76 MB/sec
Timing buffered disk reads: 210 MB in 3.07 seconds = 68.37 MB/sec
/dev/sda:
Timing cached reads: 17012 MB in 2.00 seconds = 8511.87 MB/sec
Timing buffered disk reads: 282 MB in 3.01 seconds = 93.63 MB/sec
The big difference is that the slow machine has been used a lot over time and had a lot of stuff installed, so the virtual disk is 32GB (vs 4GB and 6GB for the other VMs). What can I do to restore disk performance? I tried the VMware De-fragment and Compact commands that they didn't help. The file system is ext4 in all 3 cases.
I ended up creating a new virtual disk in VMware and manually copying the data across. It worked - the machine is now noticeably faster and hdparm reports:
The steps were:
cp -ax /mnt/sda1 /mnt/sdb1
/etc/fstab
, which referred to the old partition by UUIDs to use/dev/sda1
(or I could have used the new UUID)