OpenVZ- UBC Parameters

UBC Parameters:

                     UBC, or User BeanCounters is a set of limits and guarantees controlled per Virtual Environment. UBC is the major component of OpenVZ resource management.

 The figure shows the UBC parameters of a VPS.
Enter in to VPS and run the following command.

# cat /proc/user_beancounters
   -To show the UBC parameters of a VPS.

                   You can see if you hit the limits for some UBC parameters by analyzing the last column (named failcnt). It shows a number of fails for this counter, i.e. a number of times a parameter hit the limit. Usually what you need to do is to increase the parameter. But you need to do it carefully.

If you want to increase kmemsize,

1. Get the current values for the parameter's barrier and limit
    Let, kmemsize barrier is 'x', and its limit is 'y'.

2. Increase the values. Say, we want to increase kmemsize by 2 times.

   # vzctl set <VPSID> --kmemsize $((x*2)):$((y*2)) --save 
    The above command doubled the parameter using bash arithmetic.

By using --save flag, we denote we want to both apply the new settings to the running VE, and save them in the configuration file (from which they will be taken during next VE start).

3. Check the new configuration.

# vzcfgvalidate /etc/vz/conf/<VPSID>.conf 

Note:-You can change the other parameters as like 'kmemsize'.