How can we minimize the impact that using swap files has on virtual machine performance?
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
Disk swap files are temporary disk storage spaces used to supplement (or extend) solid-state memory. Simply stated, a memory page that is not actively used can be swapped to the disk, freeing that memory page for use by more active content. If the swapped memory page is needed later, it can be swapped back into memory from the disk. Swap files are handy because they prevent the system from running out of memory and crashing unexpectedly.
This is a well-established technique, but disk performance is easily an order of magnitude lower than solid-state memory -- the system and workload always have to wait for the disk -- so anytime a page swap must take place, the workload's performance is negatively affected.
The more a workload relies on swap files, the greater this impairment will be. For example, if the memory shortage is only small and the workload uses lots of static code that can be shuttled off to the disk and only accessed rarely, the swap file will probably have minimal impact on the VM. However, if the memory shortage is extensive and the workload uses active code, which is all accessed frequently, the swap file will probably have a major impact on the VM (perhaps even making it unusable).
There are several strategies to deal with swap file problems. In the near term, an IT technician can perform workload balancing to move one or more workloads between servers in an effort to free memory resources. By making more memory available, reliance on swap files can decrease and performance will improve. An intermediate-term solution is to upgrade the server's memory. Adding physical memory decreases the need for a swap file. The longer-term solution is to upgrade the server to a newer, more powerful model that provides more memory. However, in most cases this usually occurs during a technology refresh cycle.
Dig Deeper on Virtual machine performance management
Related Q&A from Stephen J. Bigelow
Enabling hyper-threading in a hypervisor is easier than you might think. Follow these simple steps to take advantage of hyper-threading technology in...continue reading
From watching CPU affinity settings to checking for processor availability, there are things you should consider before using a hyper-threaded ...continue reading
Depending on the scenario, hyper-threading can help or hurt processor performance in a virtual server. The trick to good performance is figuring out ...continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.