Question

Swap memory on hybrid Nutanix Cluster (i.e. SSD+HDD)

  • 9 July 2019
  • 3 replies
  • 345 views

Hi all,

I am new to Nutanix and am looking for best practices around swap space on Nutanix AHV VMs. Having SSD drives it is understood swap (writes) will decrease hardware life. Can swap be allocated only to HDD drives only and/or is it best to use a low swappiness value to lower the amount of swaps?

Thanks,

3 replies

Userlevel 3
Badge +10
A Linux best practice is to have your swap on a seperate vdisk from your root of "/" directory. Use LVM and break up your logical volumes as you wish, but I always make sure my swap is on a seperate vdisk from my root. It's meant as a last resort and you don't want the churn from swap taking away from OS performance.

The same is true with Windows and your pagefile. The Microsoft best practice is to move your pagefile to a dedicated vdisk.

Realistically in terms of ssd and hdd, we've never pinned our swap drives to ssd. You will see decreased performance on hdd, but it's meant as a temporary safety net, not a permanent solution for additional memory. If you did use SSD pinning for swap, I don't see how it would decrease ssd life unless you're constantly living in swap space. You're okay either way.

Make sure you've enabled AHV Turbo (multi-queueing). For even better performance. I'll share a link once I'm at a desktop.

Hope this helps!
@ddubuque thanks for your reply. We already setup swap on a separate logical volume. The concern is due various forums advising not to swap memory on SSD drives as their cells degrade on every erase, limiting the amount of re-writes. You are correct though at pointing that swap is meant as a temporary measure. Hence, care should be taken at scaling the RAM appropriately to minimize swaps.
Userlevel 3
Badge +10
If there is prolonged usage and you're using a TLC or even QLC SSD, I could see valid concern. The supermicro appliances typically use either SLC or MLC SSD drives.

If a system is using SLC SSD's I'd be less concerned given how they are build for intense Read/Write operations beyond the consumer grade SSD.

If a system is using TLC or QLC type SSD's, I would avoid using swap on them, as the storage density method, while much larger, degrades the cells degrades and the overall performance faster with each write and erase operation. I would overall agree with your assessment of avoiding using swap space on SSD as a general practice, with the caveat of knowing the type of drive being used.

Reply