Editing Proc/user beancounters

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 
{{UBC toc}}
 
{{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.
 
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.
 
{{Note|This article describes an old interface. This is kept for compatibility and [[BC proc entries|new one]] will be used since <code>028test008</code> kernel}}
 
  
 
== Example ==
 
== Example ==
Line 38: Line 36:
 
== Fields ==
 
== 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>.
+
=== <code>uid</code> ===
 +
The field <code>uid</code> is a numeric identifier of the Virtual Environment<ref>The name “uid” is related to the fact that OpenVZ Resource Management can used without virtualization and Virtual Environments.</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>.  
+
=== <code>held</code> and <code>maxheld</code> ===
 +
For accountable parameters, the field <code>held</code> shows the current counter for the Virtual Environment (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 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>.  
  
The field '''<code>failcnt</code>''' shows the number of refused “resource allocations” for the whole lifetime of the process group.
+
=== <code>failcnt</code> ===
 +
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
+
=== <code>barrier</code> and <code>limit</code> ===
 +
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.
 
parameters, only one of them may be used, for some parameters — both.
 
These fields may specify limits or guarantees, and the exact meaning of
 
These fields may specify limits or guarantees, and the exact meaning of
Line 51: Line 53:
 
the <code>limit</code> for the parameter.
 
the <code>limit</code> for the parameter.
  
== Units ==
+
== Units of measurement ==
{{Main|UBC parameter units}}
+
As also discussed in [[UBC parameter units]], all values related to parameters with
 +
names starting with <code>num</code> are measured in pieces. Values related to parameters
 +
with names ending with pages are measured in memory pages (memory page is 4 kilobytes on
 +
x86 and x86_64 hardware, others may differ). Values related to other parameters are measured in bytes.
  
 
== Settings ==
 
== Settings ==
Line 58: Line 63:
 
General notes about parameters and their barrier and limit settings
 
General notes about parameters and their barrier and limit settings
 
are provided in [[UBC parameters]]. Parameters not having limit setting have
 
are provided in [[UBC parameters]]. Parameters not having limit setting have
[[LONG_MAX]] in the corresponding field.
+
[[MAX_ULONG]] 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 ==
 
== Notes ==
 
<references/>
 
<references/>

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: