Changes

Jump to: navigation, search

Resource shortage

20 bytes added, 11:32, 22 May 2008
Cleaning up punctuation and grammer.
Sometimes you see a strange failures from some programs inside your [[container]]. In some cases it means one of the resources controlled by OpenVZ has hit the limit.
The first thing to do is to check the contents of the /proc/user_beancounters file in your [[container]]. The last column of output is the fail counter. Each time a resource hits the limit, the fail counter is increasingincremented. So, if you see non-zero values in the failcnt column that means something is wrong.
There are two ways to fix the situation: reconfigure (in some cases recompile) the application, or change the resource management settings.
== [[UBC]] parameters ==
Here is the an example of current [[UBC]] values obtained from <code>/proc/user_beancounters</code> file in container 123:
<pre>
# cat /proc/user_beancounters
</pre>
You can see if you hit the limits limit for some [[UBC]] parameters by analyzing the last column (named <code>failcnt</code>). It shows a number of fails failures for this counter, i.e. a number of times a parameter hit the limit. Usually what you need to do is to increase the parameter in question. But you need to do it carefully, and here is how.
<ol>
</li>
<li>Increase the values. Say, we want to increase double <code>kmemsize</code> by 2 times. This is how it can be done using built-in bash arithmetics:
<pre>
# vzctl set 123 --kmemsize $((2752512*2)):$((2936012*2)) --save
</pre>
By using the <code>--save</code> flag, we denote indicate we want to both apply the new settings setting to the running container, and save them it in the configuration file (from which they the settings will be taken during next container start).
</li>
== Disk quota ==
To check if your [[container]] ran out of exceeded its disk quota, use the following commands (inside a container):
<pre>
# df
</pre>
First The first command shows disk space usage, and the second command shows the inodes usage (you can roughly see use the inodes count as a number of files/directories on your system).
If one of the commands give you shows a usage of 100%, that means you hit have exceeded one of the disk quota limitlimits.
You can increase the limit from the host system ([[CT0]]) only. This is how:
</ol>
{{Note|shell does not support floating-point arithmeticsarithmetic, i.e. you can not use expressions like <code>$((&nbsp;220000*1.5&nbsp;))</code>. To use floating point, try <code>bc</code> instead, something like this: <code><nowiki>$(echo&nbsp;220000*1.5&nbsp;|&nbsp;bc)</nowiki></code>.}}
== CPU ==
66
edits

Navigation menu