Editing UBC secondary parameters

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 8: Line 8:
  
 
It includes all the kernel internal data structures associated with the
 
It includes all the kernel internal data structures associated with the
container's processes, except the network buffers discussed below.
+
Virtual Environment's processes, except the network buffers discussed below.
 
These data structures reside in the first gigabyte of the computer's RAM,
 
These data structures reside in the first gigabyte of the computer's RAM,
 
so called [[UBC systemwide configuration#“Low memory”|“low memory”]].
 
so called [[UBC systemwide configuration#“Low memory”|“low memory”]].
Line 21: Line 21:
 
(for example, 10%, as in [[UBC configuration examples]]).  Equal <code>barrier</code> and <code>limit</code> of
 
(for example, 10%, as in [[UBC configuration examples]]).  Equal <code>barrier</code> and <code>limit</code> of
 
the <code>kmemsize</code> parameter may lead to the situation where the kernel will
 
the <code>kmemsize</code> parameter may lead to the situation where the kernel will
need to kill container's applications to keep the <code>kmemsize</code>
+
need to kill Virtual Environment's applications to keep the <code>kmemsize</code>
 
usage under the limit.
 
usage under the limit.
  
 
<code>Kmemsize</code> limits can't be set arbitrarily high.
 
<code>Kmemsize</code> limits can't be set arbitrarily high.
The total amount of <code>kmemsize</code> consumable by all containers
+
The total amount of <code>kmemsize</code> consumable by all Virtual Environments
 
in the system plus the socket buffer space (see below) is limited by the
 
in the system plus the socket buffer space (see below) is limited by the
 
hardware resources of the system.
 
hardware resources of the system.
Line 53: Line 53:
  
 
<code>Tcpsndbuf</code> limits can't be set arbitrarily high.
 
<code>Tcpsndbuf</code> limits can't be set arbitrarily high.
The total amount of <code>tcpsndbuf</code> consumable by all containers
+
The total amount of <code>tcpsndbuf</code> consumable by all Virtual Environments
 
in the system plus the <code>kmemsize</code> and other socket buffers is limited
 
in the system plus the <code>kmemsize</code> and other socket buffers is limited
 
by the hardware resources of the system.
 
by the hardware resources of the system.
Line 84: Line 84:
  
 
<code>Tcprcvbuf</code> limits can't be set arbitrarily high.
 
<code>Tcprcvbuf</code> limits can't be set arbitrarily high.
The total amount of <code>tcprcvbuf</code> consumable by all containers
+
The total amount of <code>tcprcvbuf</code> consumable by all Virtual Environments
 
in the system plus the <code>kmemsize</code> and other socket buffers is limited
 
in the system plus the <code>kmemsize</code> and other socket buffers is limited
 
by the hardware resources of the system.
 
by the hardware resources of the system.
Line 106: Line 106:
  
 
<code>Othersockbuf</code> limits can't be set arbitrarily high.
 
<code>Othersockbuf</code> limits can't be set arbitrarily high.
The total amount of <code>othersockbuf</code> consumable by all containers
+
The total amount of <code>othersockbuf</code> consumable by all Virtual Environments
 
in the system plus the <code>kmemsize</code> and other socket buffers
 
in the system plus the <code>kmemsize</code> and other socket buffers
 
is limited by the hardware resources of the system.
 
is limited by the hardware resources of the system.
Line 119: Line 119:
  
 
<code>Dgramrcvbuf</code> limits usually don't need to be high.
 
<code>Dgramrcvbuf</code> limits usually don't need to be high.
Only if the containers needs to send and receive very large
+
Only if the Virtual Environments needs to send and receive very large
 
datagrams, the <code>barrier</code>s for both <code>othersockbuf</code> and
 
datagrams, the <code>barrier</code>s for both <code>othersockbuf</code> and
 
<code>dgramrcvbuf</code> parameters should be raised.
 
<code>dgramrcvbuf</code> parameters should be raised.
Line 133: Line 133:
  
 
<code>Dgramrcvbuf</code> limits can't be set arbitrarily high.
 
<code>Dgramrcvbuf</code> limits can't be set arbitrarily high.
The total amount of <code>dgramrcvbuf</code> consumable by all containers
+
The total amount of <code>dgramrcvbuf</code> consumable by all Virtual Environments
 
in the system plus the <code>kmemsize</code> and other socket buffers
 
in the system plus the <code>kmemsize</code> and other socket buffers
 
is limited by the hardware resources of the system.
 
is limited by the hardware resources of the system.
Line 145: Line 145:
 
If applications start to consume more memory than the computer has,
 
If applications start to consume more memory than the computer has,
 
the system faces an out-of-memory condition.
 
the system faces an out-of-memory condition.
In this case the operating system will start to kill container's
+
In this case the operating system will start to kill Virtual Environment's
 
processes to free some memory and prevent the total death
 
processes to free some memory and prevent the total death
 
of the system.  Although it happens very rarely in typical system loads,
 
of the system.  Although it happens very rarely in typical system loads,
 
killing processes in out-of-memory situations is a normal reaction of the
 
killing processes in out-of-memory situations is a normal reaction of the
system, and it is built into every Linux kernel<ref>The possible reasons of out-of-memory situations are the excess of total <code>[[vmguarpages]]</code> guarantees the available physical resources or high memory consumption by system processes.  Also, the kernel might allow some containers to allocate memory above their <code>[[vmguarpages]]</code> guarantees when the system had a lot of free memory, and later, when other containers claim their guarantees, the system will experience the memory shortage.</ref>.
+
system, and it is built into every Linux kernel<ref>The possible reasons of out-of-memory situations are the excess of total <code>[[vmguarpages]]</code> guarantees the available physical resources or high memory consumption by system processes.  Also, the kernel might allow some Virtual Environments to allocate memory above their <code>[[vmguarpages]]</code> guarantees when the system had a lot of free memory, and later, when other Virtual Environments claim their guarantees, the system will experience the memory shortage.</ref>.
  
 
<code>[[Oomguarpages]]</code> parameter accounts the total amount of
 
<code>[[Oomguarpages]]</code> parameter accounts the total amount of
 
memory and swap space used by the processes of a particular
 
memory and swap space used by the processes of a particular
container.
+
Virtual Environment.
 
The <code>barrier</code> of the <code>oomguarpages</code> parameter is the out-of-memory
 
The <code>barrier</code> of the <code>oomguarpages</code> parameter is the out-of-memory
 
guarantee.
 
guarantee.
Line 160: Line 160:
 
(the value of <code>oomguarpages</code>) plus the amount of used kernel memory
 
(the value of <code>oomguarpages</code>) plus the amount of used kernel memory
 
(<code>[[kmemsize]]</code>) and socket buffers is below the <code>barrier</code>,
 
(<code>[[kmemsize]]</code>) and socket buffers is below the <code>barrier</code>,
processes in this container are guaranteed not to be killed in
+
processes in this Virtual Environment are guaranteed not to be killed in
 
out-of-memory situations.
 
out-of-memory situations.
 
If the system is in out-of-memory situation and there are several
 
If the system is in out-of-memory situation and there are several
containers with <code>oomguarpages</code> excess, applications in the
+
Virtual Environments with <code>oomguarpages</code> excess, applications in the
container with the biggest excess will be killed first.
+
Virtual Environment with the biggest excess will be killed first.
 
The <code>failcnt</code> counter of <code>oomguarpages</code> parameter
 
The <code>failcnt</code> counter of <code>oomguarpages</code> parameter
increases when a process in this container is killed because
+
increases when a process in this Virtual Environment is killed because
 
of out-of-memory situation.
 
of out-of-memory situation.
  
Line 182: Line 182:
 
unspecified in the current version.
 
unspecified in the current version.
  
The total out-of-memory guarantees given to the containers should
+
The total out-of-memory guarantees given to the Virtual Environments should
 
not exceed the physical capacity of the computer, as discussed in [[UBC systemwide configuration#Memory and swap space]].
 
not exceed the physical capacity of the computer, as discussed in [[UBC systemwide configuration#Memory and swap space]].
 
If guarantees are given for more than the system has, in out-of-memory
 
If guarantees are given for more than the system has, in out-of-memory
situations applications in containers with guaranteed level of
+
situations applications in Virtual Environments with guaranteed level of
 
service and system daemons may be killed.
 
service and system daemons may be killed.
  
Line 196: Line 196:
 
The <code>barrier</code> and the <code>limit</code> of <code>privvmpages</code> parameter
 
The <code>barrier</code> and the <code>limit</code> of <code>privvmpages</code> parameter
 
control the upper boundary of the total size of allocated memory.
 
control the upper boundary of the total size of allocated memory.
Note that this upper boundary doesn't guarantee that the container
+
Note that this upper boundary doesn't guarantee that the Virtual Environment
 
will be able to allocate that much memory, neither does it guarantee that
 
will be able to allocate that much memory, neither does it guarantee that
other containers will be able to allocate their fair share of
+
other Virtual Environments will be able to allocate their fair share of
 
memory.
 
memory.
 
The primary mechanism to control memory allocation is the <code>[[vmguarpages]]</code>
 
The primary mechanism to control memory allocation is the <code>[[vmguarpages]]</code>
Line 206: Line 206:
 
not used yet) memory.
 
not used yet) memory.
 
The accounted value is an estimation how much memory will be really consumed
 
The accounted value is an estimation how much memory will be really consumed
when the container's applications start to use the allocated
+
when the Virtual Environment's applications start to use the allocated
 
memory.
 
memory.
 
Consumed memory is accounted into <code>[[oomguarpages]]</code> parameter.
 
Consumed memory is accounted into <code>[[oomguarpages]]</code> parameter.
  
 
Since the memory accounted into <code>privvmpages</code> may not be actually used,
 
Since the memory accounted into <code>privvmpages</code> may not be actually used,
the sum of current <code>privvmpages</code> values for all containers
+
the sum of current <code>privvmpages</code> values for all Virtual Environments
 
may exceed the RAM and swap size of the computer.
 
may exceed the RAM and swap size of the computer.
  
Line 224: Line 224:
 
Total <code>privvmpages</code> should correlate with the physical resources of the
 
Total <code>privvmpages</code> should correlate with the physical resources of the
 
computer.
 
computer.
Also, it is important not to allow any container to allocate a
+
Also, it is important not to allow any Virtual Environment to allocate a
 
significant portion of all system RAM to avoid serious service level
 
significant portion of all system RAM to avoid serious service level
 
degradation for other containers.
 
degradation for other containers.
Line 238: Line 238:
 
in [[UBC systemwide configuration]].
 
in [[UBC systemwide configuration]].
 
Those restrictions are very important, because their violation may
 
Those restrictions are very important, because their violation may
allow any container cause the whole system to hang.
+
allow any Virtual Environment cause the whole system to hang.
  
 
== Notes ==
 
== Notes ==
 
<references/>
 
<references/>

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: