Difference between revisions of "UBC parameters"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
m (minor formatting fixes in General information about all parameters)
m (formatting fix in General information about all parameters)
Line 85: Line 85:
 
<li>The parameters control
 
<li>The parameters control
 
how the resources are distributed between Virtual Environments in terms of
 
how the resources are distributed between Virtual Environments in terms of
* limits, i.e.&nbsp;upper boundaries on what this Virtual Environment can consume, and
+
<ul>
* guarantees, i.e.&nbsp;mechanisms ensuring that this Virtual Environment
+
<li>limits, i.e.&nbsp;upper boundaries on what this Virtual Environment can consume, and</li>
 +
<li>guarantees, i.e.&nbsp;mechanisms ensuring that this Virtual Environment
 
can get the assigned “resources” regardless of the activity and the amount
 
can get the assigned “resources” regardless of the activity and the amount
of resources required by other Virtual Environments.
+
of resources required by other Virtual Environments.</li>
 +
</ul>
  
 
The parameters containing “<code>guar</code>” in their names,
 
The parameters containing “<code>guar</code>” in their names,

Revision as of 04:44, 22 August 2006

All the existing parameters are listed in the below table.

By importance, the parameters are divided into 3 groups: primary parameters, secondary parameters and auxiliary parameters. More detailed description of the parameters and the resource control mechanisms governed by the parameters is provided below.

Resource control parameters table

Name Description
Primary parameters
numproc Number of processes and threads.
numtcpsock Number of TCP sockets.
numothersock Number of sockets other than TCP.
vmguarpages Memory allocation guarantee, in pages.
Secondary parameters
kmemsize Size of unswappable kernel memory, allocated for processes in this VE.
tcpsndbuf Total size of TCP send buffers.
tcprcvbuf Total size of TCP receive buffers.
othersockbuf Total size of UNIX-domain socket buffers, UDP and other datagram protocol send buffers.
dgramrcvbuf Receive buffers of UDP and other datagram protocols.
oomguarpages The guaranteed amount of memory for the case the memory is “over-booked” (out-of-memory kill guarantee), in pages.
privvmpages Memory allocation limit, in pages.
Auxiliary parameters
lockedpages Process pages not allowed to be swapped out (pages locked by mlock(2)).
shmpages Total size of shared memory (IPC, shared anonymous mappings and tmpfs objects), in pages.
physpages Total number of RAM pages used by processes.
numfile Number of open files.
numflock Number of file locks.
numpty Number of pseudo-terminals.
numsiginfo Number of siginfo structures.
dcachesize Total size of dentry and inode structures locked in memory.
numiptent Number of NETFILTER (IP packet filtering) entries.

General information about all parameters

All resource control parameters have some common properties and some differences.

  1. Most parameters provide both accounting of some system resource and allow controlling its consumption. The exceptions are physpages (accounting only) and vmguarpages (no accounting, control only), explained below.
  2. Each parameter has 2 configuration variables, called barrier and limit. Although both 2 variables are changeable, only one or none of them may be effectively used for the resource control for some parameters. For example, physpages is an accounting-only parameter and both its configuration variables are not effectively used in the current OpenVZ version. The description of each parameter explains the meaning of the barrier and the limit and what they should be set to if they are not effectively used. In general, for all parameters the barrier should not be greater than the limit.
  3. The parameters control how the resources are distributed between Virtual Environments in terms of
    • limits, i.e. upper boundaries on what this Virtual Environment can consume, and
    • guarantees, i.e. mechanisms ensuring that this Virtual Environment can get the assigned “resources” regardless of the activity and the amount of resources required by other Virtual Environments.

    The parameters containing “guar” in their names, i.e. vmguarpages and oomguarpages are Virtual Environment's guarantees. They guarantee availability of resources and certain service level up to the value, specified by the barrier, and do not guarantee above the barrier. However, these parameters do not impose usage restrictions. The guarantees are discussed in more detail in the paragraphs describing these parameters.

    The limit of vmguarpages and oomguarpages should be set to the maximal value (i.e. 2147483647 on a 32-bit architecture).

  4. For some resource limiting parameters, such as kmemsize, both barrier and limit settings are effectively used. If the resource usage exceeds the barrier but doesn't exceed the limit, vital operations (such as process stack expansion) are still allowed to allocate new resources, and other ones are not allowed. A gap between the barrier and the limit gives applications better chances to handle resource shortage gracefully. For other resource limiting parameters, such as numproc, barrier and limit should be set to the same value.
  5. Each parameter has “natural units of measurement” — the units of measurement of values shown via /proc/user_beancounters interface and accepted by vzctl. Values related to parameters with names starting with num are measured in pieces. Values related to parameters with names ending with pages are measured in memory pages (memory page is equal to 4 kilobytes on IA-32 hardware). The remaining values (parameters ending with size and buf) are measured in bytes.