7.7. Improving High-Capacity HDD Performance¶
Unlike older hard disks with 512-byte sectors, many modern HDDs (3TB and more in capacity) use 4KB physical sectors. In certain cases, this can greatly reduce system performance (by 3-4 times) due to extra Read-Modify-Write (RMW) cycles required to align the source write request. Why this happens? When an operating system issues an unaligned write request, the HDD has to align the beginning and end of that request to 4KB boundaries. To do this, the HDD reads the request’s head and tail ranges to determine an even number of sectors to modify. For example, on a request to write a 4KB block at a 2KB offset, HDD will read the 0-2KB and 6-8KB ranges to modify the entire 0-8KB data range.
The typical reasons of poor performance with 4KB sector HDDs are:
Host OS file system unaligned on the 4KB boundary. The
make-cs
command of Virtuozzo Storage tries to detect and report such issues to the administrator in advance, but be aware that thefdisk
utility is not recommended for partitioning HDDs. You should useparted
instead.Unaligned writes (e.g., 1KB) performed by guest OS. Many legacy operating systems, like Microsoft Windows XP and Windows Server 2003 or Red Hat Enterprise Linux 5.x, have unaligned partitions by default and generate unaligned I/O patterns which are quite slow on both Virtuozzo Storage and actual HDDs with 4KB sectors. If you plan running such legacy operating systems, consider the following:
Using smaller HDDs with 512-byte sectors, or use SSD journaling for CS services which mitigates the issue to some extent.
Aligning OS partitions properly as described in Aligning Disks and Partitions in Virtual Machines.
You can check for unaligned write operations in the cluster by as follows:
Run the
vstorage top
orstat
command. For example:# vstorage -c stor1 top
Press i to display the RMW and JRMW columns in the CS part of the
top
output.Check the RMW or JRMW counters, which are explained below.
When SSD journaling is used, the RMW counter shows the number of requests which lead to Read-Modify-Write cycles, while the JRMW counter shows the number of Read-Modify-Write cycles mitigated by the use of SSD journals.
When SSD journaling is not used, the JRMW counter shows the number of unaligned requests which potentially generate Read-Modify-Write cycles on the HDD in question.
7.7.1. Improving Virtual Disk Performance¶
This section lists ways of improving the performance of virtual disks.
7.7.1.1. Preventing Partition Misalignment in Legacy Operating Systems¶
Virtual disks in virtual machines running legacy guest operating systems such as Windows Server 2003, Windows XP, Windows 2000, CentOS 5, or RHEL 5 may work slower because of partition misalignment. For solutions to this issue, see Aligning Disks and Partitions in Virtual Machines.