Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

UBC parameter units

2,202 bytes added, 18:14, 13 October 2011
Change capitilization on example units to read as (mega/kilo)BYTES instead of BITS
== UBC [[User Beancounters]] have default units ==which are used when viewing and setting the parameter values. When setting the values for some parameters, you are able to specify [[#Overriding Default Units|different units]] thereby avoiding the need to do manual conversion of units and making life a little easier!
# entries which name has word 'page' are measured in memory pages (4kb on x86 and x86-64, 16kb for IA64). These are privvmpages, oomguarpages and others.# entries with names like 'num*' are measured in items. i.e. numproc - number of processes, numiptent - number of iptables entries.# other entries like kmemsize, tcprcvbuf/tcpsndbuf are measured in bytes {{UBC toc}}
== Overriding default units Pages ==
You can set parameter units implicitly when appropriate, for exampleParameters which have the suffix "page" are measured in numbers of [[memory page|pages]]. These include:
* [[UBC primary parameters|Primary Parameters]]** <code>[[vmguarpages]]</code> * [[UBC secondary parameters|Secondary Parameters]]** <code>[[privvmpages]]</code>** <code>[[oomguarpages]]</code> * [[UBC auxiliary parameters|Auxiliary Parameters]]** <code>[[lockedpages]]</code>** <code>[[shmpages]]</code>** <code>[[physpages]]</code>** <code>[[swappages]]</code> When using [[vzctl]] to set these beancounter parameters, you can override the default units of "pages" by using a [[#Overriding Default Units|valid suffix]].  == Numbers of Items == Parameters with the prefix "num" are measured in numbers of items: * [[UBC primary parameters|Primary Parameters]]** <code>[[numproc]]</code>** <code>[[numtcpsock]]</code>** <code>[[numothersock]]</code> * [[UBC secondary parameters|Secondary Parameters]]** None * [[UBC auxiliary parameters|Auxiliary Parameters]]** <code>[[numfile]]</code>** <code>[[numflock]]</code>** <code>[[numpty]]</code>** <code>[[numsiginfo]]</code>** <code>[[numiptent]]</code>   == Bytes == Other parameters are measured in bytes: * [[UBC primary parameters|Primary Parameters]]** None * [[UBC secondary parameters|Secondary Parameters]]** <code>[[kmemsize]]</code>** <code>[[tcprcvbuf]]</code>** <code>[[tcpsndbuf]]</code>** <code>[[othersockbuf]]</code>** <code>[[dgramrcvbuf]]</code> * [[UBC auxiliary parameters|Auxiliary Parameters]]** <code>[[dcachesize]]</code> When using [[vzctl]] to set these beancounter parameters, you can override the default units of "bytes" by using a [[#Overriding Default Units|valid suffix]].  == Overriding Default Units == When using [[vzctl]] to set beancounter parameters which use "Pages" or "Bytes" as the default units, alternative units may be specified using one of the following suffixes: {| class="wikitable"!Suffix! Alternative Suffix! Units|-| g || G || gigabytes|-| m || M || megabytes|-| k || K || kilobytes|-| p || P || [[memory page|pages]]|} === Examples === The following are some examples to demonstrate the use of different units when specifying the value of a parameter. Where <code>$CTID</code> is the container ID. * Set <code>kmemsize </code> limit to 512 KbKB
<pre>
# vzctl set $CTID --kmemsize 512k
</pre>
* Set <code>privvmpages </code> limit to 256 MbMB
<pre>
# vzctl set $CTID --privvmpages 256m
</pre>
* Set <code>tcprcvbuf </code> limit to 1000 pages (totals to almost 4 Mb MB on x86)
<pre>
# vzctl set $CTID --tcprcvbuf 1000p
</pre>
 
[[Category: HOWTO]]
Anonymous user