vitaprimo
Enthusiast
Enthusiast

How can I stay out of the way of transparent memory page sharing?

I created this web app VM, ensuring it's pretty vanilla until the last moment when the content is actually going to be added. It's a Postgres database, with a Docker container that runs the servlets. Previously they ran in a single VM but it's easier for each to have its own VM with their own database server respectively.

This allows vSphere snapshots to capture database state, ZFS snapshots can be triggered too and unlike vSphere this are cumulative without slowing down the VM, that's two shots at recovery before the backups. When the servlets  start running they get massive, as everything Java-based does; it was easy to see there wasn't deduplication at all in the same VM by the guest OS' part but then again the host was Windows Server 2012 R2. It was upgraded in-place to 2019 and it still seemed to lack memory deduplication. Now they're on Fedora Server 33 and hopefully the hypervisor can do a better job, even if it can't the difference between Fedora and Windows should even things out and still keep ahead.

Normally I would assume vSphere would do its magic and find out that at least the binaries are identical and act accordingly but is there anything that I can do to ensure this happens? Are there any technologies, for instance; security-related, isolation, etc. that would prevent the memory pages from being shared. Should things like IOMMU be enabled or not, y'know, what's adjusted in the VM itself outside the guest OS. Security is not a concern, BTW.

Thanks!

Labels (1)
0 Kudos
1 Reply
vbondzio
VMware Employee
VMware Employee

Am I understanding correctly that you _want_ TPS (intra and inter VM)? While (intra VM) TPS is always active, small pages are only shared once the default Host Large Pages are broken, that usually means when the host is getting tight for memory (CLEAR phase is entered at 300% minFree). You might want to check out the 2nd half here: https://www.vmworld.com/en/video-library/video-landing.html?sessionid=1589493658174001Skyo (about 26 min. in), I cover a good bit about why Large Pages are default and also why you might not want them. Now, for a large DB you might actually want LPs for performance reasons but it can't hurt to test of course. If security is no concern, then you could also enabled inter VM TPS (which is disabled by default) for a subset of VMs or all (https://kb.vmware.com/s/article/2097593).

TL;DR vSphere only does it's magic when it needs to (by default)

0 Kudos