Difference between revisions of "UBC parameter units"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(added suffixes table, more text)
(Change capitilization on example units to read as (mega/kilo)BYTES instead of BITS)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
[[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!
 +
 
{{UBC toc}}
 
{{UBC toc}}
  
 +
== Pages ==
 +
 +
Parameters 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>
  
# entries which name has word 'page' are measured in [[memory page]]s (4K on x86 and x86_64, 16K for IA64). These are <code>privvmpages</code>, <code>oomguarpages</code> and others.
+
* [[UBC secondary parameters|Secondary Parameters]]
# entries with names like 'num*' are measured in items. i.e. <code>numproc</code> - number of processes, <code>numiptent</code> - number of iptables entries.
+
** None
# other entries like <code>kmemsize</code>, <code>tcprcvbuf</code>, <code>tcpsndbuf</code> are measured in bytes
 
  
== Overriding default units ==
+
* [[UBC auxiliary parameters|Auxiliary Parameters]]
 +
** <code>[[numfile]]</code>
 +
** <code>[[numflock]]</code>
 +
** <code>[[numpty]]</code>
 +
** <code>[[numsiginfo]]</code>
 +
** <code>[[numiptent]]</code>
  
When using [[vzctl]] to set beancounter parameters, you can set units explicitly when appropriate (i.e. for all parameters which names are not starting with <code>num</code>*). The following suffixes are available:
+
 
 +
 
 +
== 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"
 
{| class="wikitable"
| g, G || gigabytes
+
!Suffix
 +
! Alternative Suffix
 +
! Units
 
|-
 
|-
| m, M || megabytes
+
| g || G || gigabytes
 
|-
 
|-
| k, K || kilobytes
+
| m || M || megabytes
 
|-
 
|-
| p, P || [[memory page]]s
+
| k || K || kilobytes
|}  
+
|-
 +
| p || P || [[memory page|pages]]
 +
|}
 +
 
 
=== Examples ===
 
=== Examples ===
  
* Set kmemsize limit to 512 Kb
+
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 KB
 
<pre>
 
<pre>
# vzctl set $VEID --kmemsize 512k
+
# vzctl set $CTID --kmemsize 512k
 
</pre>
 
</pre>
  
* Set privvmpages limit to 256 Mb
+
* Set <code>privvmpages</code> limit to 256 MB
 
<pre>
 
<pre>
# vzctl set $VEID --privvmpages 256m
+
# vzctl set $CTID --privvmpages 256m
 
</pre>
 
</pre>
  
* Set tcprcvbuf limit to 1000 pages (totals to almost 4 Mb on x86)
+
* Set <code>tcprcvbuf</code> limit to 1000 pages (totals to almost 4 MB on x86)
 
<pre>
 
<pre>
# vzctl set $VEID --tcprcvbuf 1000p
+
# vzctl set $CTID --tcprcvbuf 1000p
 
</pre>
 
</pre>
  
 
[[Category: HOWTO]]
 
[[Category: HOWTO]]

Latest revision as of 18:14, 13 October 2011

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 different units thereby avoiding the need to do manual conversion of units and making life a little easier!

User Beancounters
Definition
/proc/user_beancounters
/proc/bc/
General information
Units of measurement
VSwap
Parameters description
Primary parameters
numproc, numtcpsock, numothersock, vmguarpages
Secondary parameters
kmemsize, tcpsndbuf, tcprcvbuf, othersockbuf, dgramrcvbuf, oomguarpages, privvmpages
Auxiliary parameters
lockedpages, shmpages, physpages, numfile, numflock, numpty, numsiginfo, dcachesize, numiptent, swappages
Internals
User pages accounting
RSS fractions accounting
On-demand accounting
UBC consistency
Consistency formulae
System-wide configuration
vzubc(8)
Configuration examples
Basic
Derived
Intermediate configurations
Tables
List of parameters
Parameter properties
Consistency
Config examples

Pages[edit]

Parameters which have the suffix "page" are measured in numbers of pages. These include:

When using vzctl to set these beancounter parameters, you can override the default units of "pages" by using a valid suffix.


Numbers of Items[edit]

Parameters with the prefix "num" are measured in numbers of items:


Bytes[edit]

Other parameters are measured in bytes:

When using vzctl to set these beancounter parameters, you can override the default units of "bytes" by using a valid suffix.


Overriding Default Units[edit]

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:

Suffix Alternative Suffix Units
g G gigabytes
m M megabytes
k K kilobytes
p P pages

Examples[edit]

The following are some examples to demonstrate the use of different units when specifying the value of a parameter. Where $CTID is the container ID.

  • Set kmemsize limit to 512 KB
# vzctl set $CTID --kmemsize 512k
  • Set privvmpages limit to 256 MB
# vzctl set $CTID --privvmpages 256m
  • Set tcprcvbuf limit to 1000 pages (totals to almost 4 MB on x86)
# vzctl set $CTID --tcprcvbuf 1000p