Score:2

linux page-cache size (host) performance impact to Virtualbox VMs

id flag

i have a small Virtualisation host that runs 7 Windows 10 and CentOS VMS. The host has only 32GB RAM and that RAM is nearly used by the VMs memory and the linux host OS. There are about 2,5GB RAM left that are used by the linux host page cache.

I#m now asking myself if i can upgrade performance of the VMs by adding additional RAM that more RAM can be used by the page.cache to buffer read/write HD operations.

From my point it's the question if the Host OS is seeing only the vdi-files of the VMs (the virtual harddrives of the VMs) at a "whole" or if the host OS can see the single files the VMs-OSses are writting inside there vdi-virtual harddrives.

I searched for that but did not found any info. Can someone explain it to me please?

Thanks

Score:2
ca flag

More RAM used for pagecache will surely have a beneficial effect on VMs performance - but evaluating by how much is the hard part, due to different workloads responding in different manner to increased cache.

For example, a completely random read workload (a very rare scenario) or a totally write-bound load (somewhat more likely, but again quite unusual) will see small or not benefit at all from the increased pagecache.

That said common, more mixed workloads are going to get a significant boost.

Chris9834 avatar
id flag
well, my thought was the one: - if the OS can only "see" the vdi-disk-files of the VMs, it could only hold them in cache as a whole, which is impossible because they are much larger then the overall RAM - to boost VM performance the host OS needed to "see" what the VMs are writting INSIDE the vdi-disk-file, In this case it would have a similar performance impact then the VMs own cache. But i do not know if my thoughts are correct at all and i do not know how it really is.
shodanshok avatar
ca flag
@Chris9834 no, linux pagecache is, well, page-based - it caches 4K blocks of the underlying file. In other words, it does not need to entirely fit the to-be-cached file.
Chris9834 avatar
id flag
if it is like i understand from your words, then in fact it would make more sense to add those additional RAM to the host page-cache, then to devide it in smaller pieces and add it to the multiple VMs directly. Correct ?
shodanshok avatar
ca flag
@Chris9834 It depends on the expected usage scenario: adding more RAM to a specific VM will benefit only the selected machine, while adding it to host as a page cache means that the new resource, and the relative improvement, will be shared between all running processes.
Chris9834 avatar
id flag
There seems another fact that plays in. When i add additional RAM to the VM for page cache of the VM (in case those RAM is not used by a application inside the VM), then probably the VM page cache and the host page cache would cache the same pages. Which did not make any sense. It seems that it would be best to add just enough RAM to the VM that it can run it's applications WITHOUT using swap (disable swap at all?) and add all remaining RAM to the host for caching.
shodanshok avatar
ca flag
@Chris9834 double-caching is definitely a possibility on VMs hosting. The pagecache inside the VM, by residing on the same process, will respond faster to read requests, leaving the host-side pagecache (which is some context switches away) as a bigger pool or somewhat slower cache. Anyway, the pagecache (both host-side and guest-side) can immediately shrink itself under memory pressure, so you should not fear to have "too much" cache.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.