| Resolution | Both the host and the guest environments need to be considered, fixing only one does not always solve the problem. The top two areas of performance impact on VM performance are:memory; specifically, misconfigurationdisk and file fragmentation
1. MEMORY
Memory is straight forward, when you run out of real or virtual RAM and the guest or host operating system starts paging, this can slow the system by as much a thousand-fold and start causing a magnitude of unexpected hang/crash symptoms. When a system is consistently in a low available memory situation, this is called "thrashing". When the memory pages that applications are using are being swapped out to the paging file, even if they are active, this causes a huge bottleneck as the system tries to page in and page out all the running applications memory. Thrashing in the guest OS is particularly bad since the page file is not some special file on a special area of disk. It's just some blocks in a large file in the host OS (see below) and is treated no differently at the host OS level, no matter where the guest OS thinks it really is. When both the VM guest and host are paging to disk due to over provisioning, this can decrease system performance to almost nothing. Additionally, when this happens, operating systems such as Linux have an Out-of-Memory (OOM) killer feature that will terminate a process in order to protect the base kernel.
Recommendation:
- Assure sufficient memory is available on the host so that the VM process itself (which contains all the guest OS and application memory) is not being paged.
- Ensure sufficient memory is provided to each guest OS for normal operation plus a pre-determined high-water mark to cope with application high demand times.
For Databases running in VMWare environments, the required memory must be pre-allocated (dedicated) to the VM instead of letting the host manage it for you. The Memory Limit setting of the VM should be adjusted to the available amount of (physical) memory.
2. DISK
All file management methods (FAT, NTFS, ext3, etc) allow for fragmentation of disk file structures. This is a design feature to allow for real-time allocation of disk space no matter where the disk space needs to come from. Over time the structure of the files on the disk becomes dis-contiguous. When a fragmented file is loaded, the disk may have to perform dozens, hundreds, or even thousands of seek/reads to get all the information required to be loaded into memory. The more seek/reads required, the slower the response to the OS. Larger files are more prone to fragmentation because there is rarely sufficient contiguous space on the disk for an addition to a file to be placed right beside the current location.VMWare disk files are just regular files on your host OS. As the guest writes or updates files into the VM disk files, they grow. If there is no contiguous space available to write the update, the file becomes fragmented. Every time disk activity is performed in the guest OS, even if the guest OS has no fragmentation at all, the performance is decreased because the host OS has fragmented the VMWare disk file itself. When both the guest OS files and the host OS VMWare disk files are fragmented, there is serious degradation in performance. This is less predominant with SSD technologies.Recommendation:When the VM instance is created, pre-allocate all the virtual disks into contiguous space. This requires that the full disk space is available in a contiguous block in advance in order that when files are created, they are not fragmented on the host OS. (eg. a 100Gb EIDE disk for the VM requires 100Gb of free and contiguous disk space on the host OS). If the VM is already created, there is usually process that can be used to de-fragment the guest and then the VMWare disk files on the host to increase performance. For Databases running in VMWare environments, consider assuring this by using fixed database extents.
3. NETWORK
Some virtualization software utilizes basic virtualized network card drivers (virtual network devices) that do not offer the best performance. For example, VMWARE by default configures machines with the E1000 network card drivers, where the NIC VMXNET 3 is designed for performance.
OTHER ADVANCED TUNING
There are many other considerations when it comes to performance and application stability in virtualized environments, like pre-allocating all the required memory to the VM instead of letting VM manage it for you, settings for virtual write caching to name a few. There are also tuning procedures for the host OS to consider, like turning off processes or services that are not required, the impact of virtual machine snapshots during the OpenEdge update process and power-management settings of the ESX server. Power-saving features, such as Dell's Performance-per-watt (DAPC), can be mitigated by switching to a Performance profile where power-saving features are disabled. This should all be checked with the vendor of the virtualization technology. |
|
|---|