UserBeanCounters resources, vmguarpages and kmemsize explained

If you're hosted on a VPS, the below would explain if you are getting the resources that you paid for:

As mentioned in the resources (/proc/user_beancounters):

vmguarpages	0	30,000	2,147,483,647	4KB pages	\
      Memory allocation guarantee

This is the guaranteed RAM you get which works out to be:

30000 x 4 / 1024 = 117.1875 MB

Accordingly kmemsize is set to:

kmemsize	7,167,393	12,288,832	13,517,715	bytes	\
     Size of unswappable memory, allocated by the operating system kernel

Minimum kmemsize should be 10% of the vmguarpages, which is correct for the current setup:

12288832/1024/1024 = 11.7 MB == 10% of 117 (vmgaurpges)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Source for the 10% guideline?

I read your article and I see that you say that "minimum kmemsize should be 10% of the vmguarpages". I am curious to know if this guideline should apply to other hosts as well, or if it was meant only to apply to the example. I haven't been able to find any other sources that recommend it be 10%, but would be interested to know if it should be a standard practice, as our current host isn't doing this (our vmguarpages is 131,072, but kmemsize is only 12.89 MB).

meminfo evaluation within openvz container

After changing privvmpages, reset meminfo evaluation via:

vzctl set <VEID> --meminfo none --save
vzctl set <VEID> --meminfo privvmpages:1 --save

oomguarpages and privvmpages

oomguarpages is guaranteed RAM, which should typically be set the same for vmguarpages.
privvmpages is burst allowed and should reflect what you see with `free -m` for total and used.

The actual 'consumed at this moment' memory is accounted for in the oomguarpages parameter.

Total privvmpages limits set for all VE should reflect the actual physical hardware resources of the Hardware Node. Do not allow any single VE to allocate a significant portion of all system RAM to avoid very serious service level degradation for other VE's on the same host.