Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

UBC configuration examples

207 bytes added, 13:52, 25 January 2011
MAX_ULONG -> LONG_MAX
Table [[UBC configuration examples table]] contains example settings of the system resources
parameters. There are 4 example configurations — A, B, C and D, in the
order of increasing Virtual Environment container power.
“Power” represents the power of the Virtual Environmentcontainer. It is shownas the RAM size of the computer slash number of Virtual Environments containers ofthis type that can be run on such a computer.  In all examples it's assumed, that the system has swap space twice bigger than the RAM, so total virtual memory size is 3*(RAM size). But it's not OpenVZ specific requirement to have so much swap space - you can configure your swap as you usually do in linux and even don't have it at all.
“Helper values” are intermediate values, produced during computation
the units are explicitly specified). The natural units of measurement are the
units in which the values are accepted by [[vzctl]] command and stored in
Virtual Environment container configuration file.
For parameters with names ending in “pages” the natural units of measurement are pages.
=== Example A ===
This is a configuration of a most “light” Virtual Environmentcontainer.
It has 15 processes on average and can have up to 40 network connections.
This configuration allows to run a simple Web server, handling static and
number of spawned processes and memory consumption.
A computer with 2GB of RAM (+ 4GB swap) can run up to 400 of such Virtual Environmentscontainers.
Here is an example <code>pstree(1)</code> output inside such a Virtual Environmentcontainer:
<pre>[root@test /root]# pstree
init-+-crond
up to 80 network connections.
A computer with 2GB of RAM (+ 4GB swap) can run up to 120 of such Virtual Environmentrscontainerrs.
=== Example C ===
up to 200 simultaneous clients can also work with this configuration. The
configuration is designed for 200 processes on average, up to 500 network
connections and about 250MB of RAM for each Virtual Environmentcontainer.
=== Example D ===
Example D is a configuration for 1 Virtual Environment container on a computer
and emulates a stand-alone server. It roughly corresponds to the default
configuration of a stand-alone Linux system.
'''Caution''': it is not a safe configuration. Like a stand-alone Linux system,
it can hang if too much memory is consumed. It isn't a security problem,
because it is a configuration for only 1 Virtual Environment container on a computer.
However, to make the configuration more robust and protect the system from
silent hangs, <code>[[numproc]]</code>, <code>[[kmemsize]]</code> and
For compatibility with future versions, the <code>limit</code>s of <code>[[vmguarpages]]</code>,
<code>[[oomguarpages]]</code>, <code>[[physpages]]</code> should be set to [[MAX_ULONGLONG_MAX]]. The <code>barrier</code> of
<code>[[physpages]]</code> should be set to 0.