Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Proc/user beancounters

294 bytes added, 23:28, 15 August 2011
Reading: fixed a typo
{{UBC toc}}
{{DISPLAYTITLE:/proc/user_beancounters}}
The proc filesystem entry showing resource control information is <code>/proc/user_beancounters</code> file. An example content of <code>/proc/user_beancounters</code> is shown below.
== Fields == === <code>uid</code> ===The field <code>uid</code> is a numeric identifier of the Virtual Environment<ref>The name “uid” {{Note|This article describes an old interface. This is related to the fact that OpenVZ Resource Management can used without virtualization and Virtual Environments.</ref>. === <code>held</code> and <code>maxheld</code> ===For accountable parameters, the field <code>held</code> shows the current counter kept for the Virtual Environment (resource “usage”), compatibility and the field [[BC proc entries|new one]] will be used since <code>maxheld028test008</code> shows the counter's maximum for the last accounting period. The accounting period is usually the lifetime of the Virtual Environment<ref>The lifetime of a Virtual Environment is the period from the start of the VE till the time all processes in the VE exited and all resources used by these processes are freed. Usually, the lifetime is just the time between the start and the stop of the Virtual Environment.</ref>. kernel}}
=== <code>failcnt</code> ===The field <code>failcnt</code> shows the number of refused “resource allocations” for the whole lifetime of the process group. === <code>barrier</code> and <code>limit</code> ===The <code>barrier</code> and <code>limit</code> fields are resource control settings. For someparameters, only one of them may be used, for some parameters — both.These fields may specify limits or guarantees, and the exact meaning ofthem is parameter-specific. Description of each parameter in [[UBC parameters]]contains information about the difference between the <code>barrier</code> andthe <code>limit</code> for the parameter. == Units of measurement ==As also discussed in [[UBC parameter units]], all values related to parameters withnames starting with <code>num</code> are measured in pieces. Values related to parameterswith names ending with pages are measured in memory pages (memory page is 4 kilobytes onx86 and x86_64 hardware, others may differ). Values related to other parameters are measured in bytes. == Settings == General notes about parameters and their barrier and limit settingsare provided in [[UBC parameters]]. Parameters not having limit setting have[[MAX_ULONG]] in the corresponding field. == Example of <code>/proc/user_beancounter</code> ==
<pre>
# cat /proc/user_beancounters
numiptent 10 16 128 128 0
</pre>
 
== Fields ==
 
The field '''<code>uid</code>''' is a numeric identifier of the container<ref>The name “uid” is related to the fact that OpenVZ Resource Management can be used without virtualization and containers.</ref>.
 
For accountable parameters, the field '''<code>held</code>''' shows the current counter for the container (resource “usage”), and the field '''<code>maxheld</code>''' shows the counter's maximum for the last accounting period. The accounting period is usually the lifetime of the container<ref>The lifetime of a container is the period from the start of the container till the time all processes in the container exited and all resources used by these processes are freed. Usually, the lifetime is just the time between the start and the stop of the container.</ref>.
 
The field '''<code>failcnt</code>''' shows the number of refused “resource allocations” for the whole lifetime of the process group.
 
The '''<code>barrier</code>''' and '''<code>limit</code>''' fields are resource control settings. For some
parameters, only one of them may be used, for some parameters — both.
These fields may specify limits or guarantees, and the exact meaning of
them is parameter-specific. Description of each parameter in [[UBC parameters]]
contains information about the difference between the <code>barrier</code> and
the <code>limit</code> for the parameter.
 
== Units ==
{{Main|UBC parameter units}}
 
== Settings ==
 
General notes about parameters and their barrier and limit settings
are provided in [[UBC parameters]]. Parameters not having limit setting have
[[LONG_MAX]] in the corresponding field.
 
== Reading ==
 
{{Note|It's easier to use [[BC proc entries|the new <code>/proc/bc</code> interface]], i.e. <code>cat /proc/bc/$CTID/resources</code>.}}
 
If you want to print UBC values for a specific container, the following construct can be helpful
 
<nowiki>egrep -A23 "${CTID}:" /proc/user_beancounters</nowiki>
 
Or with headers, though slightly harder to remember:
 
<nowiki>sed -nr "1,2p;/${CTID}:/,+23p" /proc/user_beancounters</nowiki>
 
Here <code>${CTID}</code> is the ID of the container you are interested in.
 
In case you want to print UBC values for a few containers at once, set CTID to something like <code>(101|102|103)</code>.
== Notes ==
<references/>
16
edits