2.1.2.2. Resource Management Parameters

All resource management parameters can be subdivided into the CPU, disk, system, and VSwap categories for your convenience. Any parameter can be set with the prlctl set command and the corresponding option name (in the lower case, e.g., --cpuunits for CPUUNITS, etc.). See Chapter 3, Managing Containers for more details. The Typical value column, if present, specifies a range of reasonable parameter values for different applications, from light to huge heavy loaded containers. If the barrier and limit fields are in use, ranges for both thresholds are given.

Table 2.6. CPU Parameters

ParameterDescriptionTypical value

CPUUNITS

CPU weight. This is a positive integer number that defines how much CPU time the container can get as compared to the other virtual machines and containers running on the server. The larger the number, the more CPU time the container can receive. Possible values range from 8 to 500000. If this parameter is not set, the default value of 1000 is used.

250...1000

CPULIMIT, CPULIMIT_MHZ

CPU limit, in per cent  (CPULIMIT) or megahertz (CPULIMIT_MHZ), the container is not allowed to exceed. The parameter is not set for newly created containers; so they can consume all free CPU power of the server. When setting this parameter in per cent, keep in mind that one CPU core makes up 100%. So if the server has 4 CPU cores, the total CPU power will equal 400%.

 

CPUS

Number of CPU cores defining the CPU limit for a container. The limit is calculated by multiplying the power of one CPU core by the number of the specified CPU cores. This option also defines the number of CPUs shown to users from inside a container. This parameter is not set for newly created containers; so they can consume all free CPU power of the server.

 

CPUMASK

The CPU affinity mask defining which CPUs on the Node can be used to handle the processes running in the container. The CPU mask can be specified as both separate CPU index numbers (1,2,3) and CPU ranges (2-4,5-7).

 

NODEMASK

The NUMA node mask defining a NUMA node to bind the container to. Once you set the mask, the processes running in the container will be executed only on the CPUs that belong to the specified NUMA node.

 

Table 2.7. Disk Parameters

ParameterDescriptionTypical value

DISKSPACE

Total size of disk space that can be consumed by the container, in 1 KB blocks.

 

QUOTAUGIDLIMIT

This parameter enables (if set to a value other than 0) or disables (if set to 0) per-user and per-group quotas for further management with the standard Linux quota utility. Enabling per-user and per-group quotas for a container requires restarting the container.

0...N

IOPRIO

The container priority for disk I/O operations. The higher the priority, the more time the container has for writing to and reading from the disk. The default container priority is 4.

0-7

IOPSLIMIT

The maximum number of disk input and output operations per second a container is allowed to perform. By default, any newly created container does not have the IOPS limit set and can perform so many disk I/O operations per second as necessary.

 

IOLIMIT

The bandwidth a container is allowed to use for its disk input and output (I/O) operations. By default, the limit is set in megabytes per second. However, you can use the following suffixes to use other measurement units:

  • G - sets the limit in gigabytes per second.
  • K - sets the limit in kilobytes per second.
  • B - sets the limit in bytes per second.

In the current version of OpenVZ, the maximum I/O bandwidth limit you can set for a container is 2 GB per second.

The default I/O bandwidth limit for all newly created containers is set to 0, which means that no limits are applied to any containers.

 

Table 2.8. System Parameters

ParameterDescriptionTypical value

NUMPROC

Number of processes and threads allowed. Upon hitting this limit, container will not be able to start a new process or thread.

40...400

AVNUMPROC

Number of processes expected to run in the container on average. This is informational parameter used to ensure configuration correctness.

0...NUMPROC

VMGUARPAGES

Memory allocation guarantee, in pages. Applications are guaranteed to be able to allocate memory while the amount of memory accounted as privvmpages does not exceed the configured barrier of the vmguarpages parameter. Above the barrier, memory allocation is not guaranteed and may fail in case of overall memory shortage.

1725...107520

LOCKEDPAGES

Memory not allowed to be swapped out (locked with the mlock() system call), in pages (one page is 4 KB).

4...4096

SHMPAGES

Total size of shared memory (including IPC, shared anonymous mappings and tmpfs objects), allocated by processes of a particular container, in pages.

512...16384

PRIVVMPAGES

Size of private (or potentially private) memory, allocated by an application. Memory that is always shared among different applications is not included in this resource parameter.

 

NUMFILE

Number of files opened by all container processes.

512...8192

NUMFLOCK

Number of file locks created by all container processes.

50...200-60...220

NUMPTY

Number of pseudo-terminals. For example, the ssh session, screen, the xterm application consumes pseudo-terminal resources.

4...64

NUMSIGINFO

Number of siginfo structures (essentially this parameter limits the size of signal delivery queue).

256...512

PHYSPAGES

Total size of RAM used by processes. This parameter is used for accounting purposes only. It shows the usage of RAM by the container. For memory pages used by several different containers (mappings of shared libraries, for example), only a fraction of a page is charged to each container. The sum of the physpages for all containers corresponds to the total number of pages used in the system by all accounted users.

Not limited

NUMIPTENT

The number of IP packet filtering entries.

12...128

Table 2.9. VSwap Parameters

ParameterDescriptionTypical value

PHYSPAGES

Amount of RAM that can be used by the processes of a container, in 4KB pages.

 

SWAP

Amount of swap space that can be used by the container for swapping out memory once the RAM is exceeded, in 4KB pages.

 

VM_OVERCOMMIT

Memory overcommit factor that defines the memory allocation limit for a container. The limit is calculated as (PHYSPAGES + SWAP) * factor.

Not limited