Maximum RAM size for a VM with "largepages" off in VirtualBox?

0

I'm suffering from heavy performance issues more detailed explained in this and that other question. From what I've tested so far, there's a direct relationship to the amount of memory assigned to a VM: Problem occurs with 48 GiB of RAM and doesn't with only 6 GiB or even 24 GiB of RAM. Additionally, it seems that enabling the setting largepages of the VM has a positive impact as well, even though it couldn't work around the problem entirely. It only seems to happen a bit later.

That is interesting, because that setting doesn't seem to be enabled by default on Linux, the docs only tell about ~5 % improvement, not that it's necessary at all for decent performance at some RAM size, and additionally there are circumstances in which largepages is ignored by VirtualBox altogether.

00:00:42.866663 PGMR3PhysAllocateLargePage: allocating large pages takes too long (last attempt 103 ms; nr of timeouts 11); DISABLE

https://www.virtualbox.org/attachment/ticket/16518/VBox_16518_5112.log#L1154

So currently in my opinion it seems unclear under which circumstances largepages is not only suggested, but required by VirtualBox to operate properly. To distinguish that, one needs to know which RAM sizes for VMs were used in the past without largepages and which weren't because of performance issues like those I'm seeing, if at all.

Thorsten Schöning

Posted 2018-05-28T11:31:10.750

Reputation: 523

@tiago-caldeira Your new title targets only people who think to know the exact answer and I very much doubt that many are out there. I want a broad audience, lots of experiences and create the correct answer afterwards. If such exists at all. – Thorsten Schöning – 2018-05-28T13:22:51.537

We're not a discussion forum. This is an Q&A website. We want technical insights and not "i got 40gb max" and then other user answers "i already tried with 42gb and it works". And that title was really asking for that. The new title will certainly unleash accurate answers. – CaldeiraG – 2018-05-28T15:23:48.890

If no one knows the exact answer, because it is not documented or such anywhere, experiences from people saying what worked and what didn't is the only way to create the needed facts! I already spent DAYS looking for the answer and didn't find anything anywhere. But go ahead, tell me with your two months membership what this site is all about... – Thorsten Schöning – 2018-05-28T16:08:23.333

Alright, I get it. But the newer title is more appropriate here. Other users accepted my suggested edit. You don't want to mess around with me because I only joined 2 months ago, if I wasn't a great user of Superuser, I wouldn't get 1k+ reputation ;)

– CaldeiraG – 2018-05-29T11:20:58.377

Answers

0

The behaviour I see pretty well fits to the following problem discussed for the Linux-Kernel:

Dueling memory-management performance regressions

Even though it talks about swapping mostly, the author of the patch fixing this got heavy-CPU-load only as well:

vfio is a good test because by pinning all memory it avoids the swapping and reclaim only wastes CPU, a memhog based test would created swapout storms and supposedly show a bigger stddev.

The one thing I'm not sure about is the influence of Transparent Huge Pages because while enabled by default in my system, VirtualBox doesn't seem to use those and they seem to be opt-in in general regarding OS-settings:

$ cat /sys/kernel/mm/transparent_hugepage/enabled
always [madvise] never
$ cat /sys/kernel/mm/transparent_hugepage/defrag
always defer defer+madvise [madvise] never

Everything else fits perfectly well to what I saw, so largepages might really only have improved things a little, but is not strictly necessary to run VMs with large amounts of memory at all. Currently it seems the problem is a "bug" in the Linux-kernel itself instead.

Thorsten Schöning

Posted 2018-05-28T11:31:10.750

Reputation: 523