Advice for memory optimisation / overcommit

Joe Botha

Well-Known Member
Apr 11, 2019
30
1
48
Cape Town
www.atomicaccess.co.za
Hi

I imagine some VPS hosting companies have ways to sell more memory than their servers actually have. How do they do this? Any advice for making the most of your server memory?

A few ideas so far:

* Use containers rather than VMs - pretty obvious
* Make sure KSM (Kernel Samepage Merging) is enabled, and try run the same OS in the VMs / containers
* Give each VM some swap space on a fast disk
* In the case of container hosting, give the hostOS swap space on a fast disk
* Use Intel Optane pmem dimms - probably expensive and only really available in their Scalable Xeon range of CPUs
* Install an Optane SSD for swap space, something like the P5800X / PCIe4 (almost 8GB/s read speeds)

Anybody using some of these ideas or have better solutions? Any guidelines to follow or can you point me at things to read?

I'm thinking a server with 128G RAM and Optane SSD with KSM enabled could maybe run 100 x 2GB containers.

Do you know of any extreme cases of VMs or containers per host?
 
I'm thinking a server with 128G RAM and Optane SSD with KSM enabled could maybe run 100 x 2GB containers.
Optane DC SSDs are quite expensive. I doubt that you get any cost savings by using this approach.
Additional 128GB DDR4 Reg. ECC RAM would cost just around $600 - $800.
 
Last edited:
AFAIK KSM does not work with LX(C) containers or even normal linux processes due to not using memory that has the MADV_MERGEABLE flag, so you're limite to KVM/QEMU VMs, which does set this flag for alle memory allocated to the guest.
 
I imagine some VPS hosting companies have ways to sell more memory than their servers actually have. How do they do this?

The same way as ISPs oversell bandwidth by playing a numbers game
ie. expecting that, on average, users will not use more than 50% of RAM, thus 100 x 2G VPS's expecting to not use more than 100*2*0.5GB of RAM.

Some even enforce (inside VMs) echo 3 > /proc/sys/vm/drop_caches and others have (slow) swap with higher swappiness.

Ditto for CPU usage, where some even have clauses about not running crypto mining etc.
 
Any progress on this? Is there a equivalent for AMD (intel Optane)

I imagine you're talking about actual server hardware as opposed to consumer hardware, but FWIW I'm running Proxmox on an AMD 5750GE mini desktop PC with an Optane NVMe stick in it that serves as swap for the host and guests. Works great, I'm happy with it.

Edit: I also use Optane in NVMe form factor on a couple other Proxmox installs on Intel-based consumer PCs, and in those cases I'm using it via 'lvmcache' as cache for the LVM thin pool where guest disks live, since that pool is on slower storage. Again, works quite well, though I haven't done rigorous testing.

I've seen some things about how Intel CPUs with built-in support were required for some types of Optane devices, but this doesn't seem to apply to all Optane products.

Get them now, new old stock is selling out and once it's gone it's gone.
 
Last edited:
I've seen some things about how Intel CPUs with built-in support were required for some types of Optane devices, but this doesn't seem to apply to all Optane products.
AFAIK, this was also only for Windows-based operating system in which the optane and the local harddisk was "merged" into one disk. We used it a lot back in the days for speeding up harddisk/optane combinations, yet this technology did not work properly with full-ssd systems.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!