6,534
edits
Changes
created
System resource control parameters have certain interdependencies. Constraints on the parameter settings are listed below. Indexes <code>bar and <code>lim</code> in the formulae below mean the barrier and the limit of the parameters, respectively.
Configuration of resource control parameters for a Virtual Environment
is invalid if these constraints are not satisfied. The best way to ensure the
validity of the configuration is to use [http://openvz.org/documentation/man/vzcfgvalidate.8 vzcfgvaludate(8)] utility.
All the interdependencies discussed below and their importance are summarized in [[UBC interdependencies table]].
The configured limits can be checked through
* <code>/proc/user beancounters</code> interface;
* Virtual Environment configuration files in <code>/etc/vz/conf/</code> directory.
== kmemsize should be enough for the expected number of processes ==
<math>kmemsize_{bar} \ge 40KB \cdot avnumproc + dcachesize_{lim}</math>
(<code>avnumproc</code> here stands for the expected average number of processes).
This constraint is important for reliable work of applications in the
Virtual Environment.
If it is not satisfied, applications will start to fail at the middle of
operations instead of failing at the moment of spawning more processes,
and the application abilities to handle resource shortage will be very
limited.
== Memory allocation limits should not be less than the guarantee ==
<math> privvmpages_{bar} \ge vmguarpages_{bar}</math>
If this constraint is not satisfied, <code>vmguarpages</code> will not work.
== Send buffers should have enough space for all sockets ==
<math>tcpsndbuf_{lim} - tcpsndbuf_{bar} \ge 2.5KB \cdot numtcpsock</math>
<math>othersockbuf_{lim} - othersockbuf_{bar} \ge 2.5KB \cdot numothersock</math>
These constraints are also important.
If they are not satisfied, transmission of data over the sockets
may hang in some circumstances.
== Other TCP socket buffers should be big enough ==
<math>tcprcvbuf_{lim} - tcprcvbuf_{bar} \ge 2.5KB \cdot numtcpsock</math>
<math>tcprcvbuf_{bar} \ge 64KB</math>
<math>tcpsndbuf_{bar} \ge 64KB</math>
Selecting the left side equal to the right side in the inequalities
above ensures minimal performance of network communications.
Increasing the left side will increase performance to certain extent.
== UDP socket buffers should be big enough if the system is not tight on memory ==
<math>dgramrcvbuf_{bar} \ge 129KB</math>
<math>othersockbuf_{bar} \ge 129KB</math>
These constraints are desired, but not essential.
Big enough buffers for UDP sockets improve reliability of datagram delivery.
However, note that if the UDP traffic is so bursty that it needs larger
buffers, the datagrams will likely be lost not because of resource control
limits, but because of other memory and performance limitations.
== Number of file limit should be adequate for the expected number of processes ==
<math>numfile \ge avnumproc \cdot 32</math>
Note that each process after <code>execve(2)</code> system call
requires a file for each loaded shared library.
Too low <code>numfile</code> limit will increase the chances of failures
during <code>execve(2)</code> call with diagnostics not clear
for the users.
== The limit on the total size of <code>dentry</code> and <code>inode</code> structures locked in memory should be adequate for allowed number of files ==
<math>dcachesize_{bar} \ge numfile \cdot 384\ \rm(bytes)</math>
Too low <code>dcachesize</code> limit will increase the chances of
file operation refusals not expected by applications.
== Barrier should be less or equal than limit ==
In addition to the conditions listed above,
<math>barrier \le limit</math>
should be maintained for each parameter.
Configuration of resource control parameters for a Virtual Environment
is invalid if these constraints are not satisfied. The best way to ensure the
validity of the configuration is to use [http://openvz.org/documentation/man/vzcfgvalidate.8 vzcfgvaludate(8)] utility.
All the interdependencies discussed below and their importance are summarized in [[UBC interdependencies table]].
The configured limits can be checked through
* <code>/proc/user beancounters</code> interface;
* Virtual Environment configuration files in <code>/etc/vz/conf/</code> directory.
== kmemsize should be enough for the expected number of processes ==
<math>kmemsize_{bar} \ge 40KB \cdot avnumproc + dcachesize_{lim}</math>
(<code>avnumproc</code> here stands for the expected average number of processes).
This constraint is important for reliable work of applications in the
Virtual Environment.
If it is not satisfied, applications will start to fail at the middle of
operations instead of failing at the moment of spawning more processes,
and the application abilities to handle resource shortage will be very
limited.
== Memory allocation limits should not be less than the guarantee ==
<math> privvmpages_{bar} \ge vmguarpages_{bar}</math>
If this constraint is not satisfied, <code>vmguarpages</code> will not work.
== Send buffers should have enough space for all sockets ==
<math>tcpsndbuf_{lim} - tcpsndbuf_{bar} \ge 2.5KB \cdot numtcpsock</math>
<math>othersockbuf_{lim} - othersockbuf_{bar} \ge 2.5KB \cdot numothersock</math>
These constraints are also important.
If they are not satisfied, transmission of data over the sockets
may hang in some circumstances.
== Other TCP socket buffers should be big enough ==
<math>tcprcvbuf_{lim} - tcprcvbuf_{bar} \ge 2.5KB \cdot numtcpsock</math>
<math>tcprcvbuf_{bar} \ge 64KB</math>
<math>tcpsndbuf_{bar} \ge 64KB</math>
Selecting the left side equal to the right side in the inequalities
above ensures minimal performance of network communications.
Increasing the left side will increase performance to certain extent.
== UDP socket buffers should be big enough if the system is not tight on memory ==
<math>dgramrcvbuf_{bar} \ge 129KB</math>
<math>othersockbuf_{bar} \ge 129KB</math>
These constraints are desired, but not essential.
Big enough buffers for UDP sockets improve reliability of datagram delivery.
However, note that if the UDP traffic is so bursty that it needs larger
buffers, the datagrams will likely be lost not because of resource control
limits, but because of other memory and performance limitations.
== Number of file limit should be adequate for the expected number of processes ==
<math>numfile \ge avnumproc \cdot 32</math>
Note that each process after <code>execve(2)</code> system call
requires a file for each loaded shared library.
Too low <code>numfile</code> limit will increase the chances of failures
during <code>execve(2)</code> call with diagnostics not clear
for the users.
== The limit on the total size of <code>dentry</code> and <code>inode</code> structures locked in memory should be adequate for allowed number of files ==
<math>dcachesize_{bar} \ge numfile \cdot 384\ \rm(bytes)</math>
Too low <code>dcachesize</code> limit will increase the chances of
file operation refusals not expected by applications.
== Barrier should be less or equal than limit ==
In addition to the conditions listed above,
<math>barrier \le limit</math>
should be maintained for each parameter.