Boosting server performance: placing the swap file on a separate HDD

Server image
One way to boost performance

Businesses that have moved to virtualised machines need to ensure they have a regime in place to ensure their installations are running at optimised performance.

One way to gain a boost in performance is to move the swap file away from the default drive.

Moving the swap file to its own dedicated hard drive is one option to increase performance within any given virtual machine. However, as the swap file by its nature is only created when the available physical memory of the server is restricted, IT managers can optimise their servers by installing more memory.

As storage is low cost, this is an easy win for IT managers tasked with improving the performance of their servers. A good example of the possible memory expansion includes the moves by Dell to offer SSD storage on some of its PowerEdge servers.

Troubleshooting

VMware states: "Moving the swap file to an alternate datastore is a useful troubleshooting step if the virtual machine or guest operating system is experiencing failures, including STOP errors, read-only file systems, and severe performance degradation issues during periods of high I/O."

Before any changes are made to the location of the swap file it is advisable to read the appropriate guidance in the Virtual Machine Admin Guide [https://www.vmware.com/support/pubs/].

As all ESX/ESXi hosts will only power on their virtual machines when they can create a swap file, it is vital that any changes to its location are carried out correctly.

In addition, system adminstrators should check that there is enough space for the swap file to be created on any host that vMotion can access.

The management of the swap file must be carefully assessed and decisions made whether this should be located with the configuration file (set up by default) or moved to another location. VMware has best practice guidance that includes this advice:

"If swapping cannot be avoided, placing the virtual machine's swap file on a high-speed high bandwidth storage system will result in the smallest performance impact. The swap file location can be set with the sched.swap.dir option in the vSphere Client (select Edit virtual machine settings, choose the Options tab, select Advanced, and click Configuration Parameters).

"If this option is not set, the swap file will be created in the virtual machine's working directory: either the directory specified by workingDir in the virtual machine's .vmx file, or, if this variable is not set, in the directory where the .vmx file is located. The latter is the default behaviour."

Decision time

Clearly a decision has to be made whether moving the swap file to its own dedicated memory will offer any performance boost.

For servers with limited memory resources this move could offer an advantage, but it's not a long term solution. This would make a priority of more installed memory to ensure that when the swap file is activated it will not adversely affect the overall performance of the server.

Latest in Pro
URL phishing
HaveIBeenPwned owner suffers phishing attack that stole his Mailchimp mailing list
Ransomware
Cl0p resurgence drives ransomware attacks to new highs in 2025
Millwall FC The Den
The UK's first football club mobile network is here - but you probably won't guess which team has launched it
A person using a smartphone with a cybersecurity lock symbol appearing over it.
The growing threat of device code phishing and how to defend against It
Cybersecurity
Why OT security needs exposure management to break the cycle of endless patching
Employees sat around together discussing business issues.
AI deregulation: what smart leaders do when the rules go off the rails
Latest in News
URL phishing
HaveIBeenPwned owner suffers phishing attack that stole his Mailchimp mailing list
Ransomware
Cl0p resurgence drives ransomware attacks to new highs in 2025
Millwall FC The Den
The UK's first football club mobile network is here - but you probably won't guess which team has launched it
The Witcher 4
You're probably not playing The Witcher 4 until 2027 at the earliest, per CD Projekt's latest financial update
Apple iPhone 16 Pro REVIEW
The iPhone 17 Air looks impressively slim in this new comparison image, but that just makes me more worried about the specs
Matt Murdock smiling in Daredevil: Born Again episode 5 and Kamala Khan looking stunned in The Marvels
Daredevil: Born Again episode 5 just revealed what Kamala Khan has been up to since The Marvels, and now I'm more excited for the next superhero team to appear in the MCU