Editing Resource shortage
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 90: | Line 90: | ||
vzctl set 123 --diskspace $(( 1048576*2 )):$(( 1153434*2 )) --save | vzctl set 123 --diskspace $(( 1048576*2 )):$(( 1153434*2 )) --save | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</li> | </li> | ||
Line 111: | Line 99: | ||
</ol> | </ol> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{Note|shell does not support floating-point arithmetic, i.e. you can not use expressions like <code>$(( 220000*1.5 ))</code>. To use floating point, try <code>bc</code> instead, something like this: <code><nowiki>$(echo 220000*1.5 | bc)</nowiki></code>.}} | {{Note|shell does not support floating-point arithmetic, i.e. you can not use expressions like <code>$(( 220000*1.5 ))</code>. To use floating point, try <code>bc</code> instead, something like this: <code><nowiki>$(echo 220000*1.5 | bc)</nowiki></code>.}} | ||
Line 124: | Line 105: | ||
There are two parameters controlling fair CPU scheduler in OpenVZ: cpuunits and cpulimit. | There are two parameters controlling fair CPU scheduler in OpenVZ: cpuunits and cpulimit. | ||
− | |||
Cpuunits are set via | Cpuunits are set via | ||
<pre> | <pre> | ||
Line 138: | Line 118: | ||
</pre> | </pre> | ||
− | If we started a | + | If we started a cpu intensive application on each VE, then 103 would be given 3 times as much cpu time as 101 and 102 would get twice as much as 101, but some fraction of what 103 got. Here's how to determine what the real ratios are. |
Add the three units, 1000+2000+3000 = 6000 | Add the three units, 1000+2000+3000 = 6000 | ||
− | + | 101 gets 1000/6000 or 1/6th of the time. (16%) | |
− | + | 102 gets 2000/6000 or 1/3rd of the time. (34%) | |
− | + | 103 gets 3000/6000 or 1/2 of the time. (50%) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | CPULIMIT | |
The cpulimit parameter sets the absolute maximum limit for a container to a percent value. For instance: | The cpulimit parameter sets the absolute maximum limit for a container to a percent value. For instance: | ||
Line 158: | Line 132: | ||
vzctl set 101 --cpulimit 25 --save | vzctl set 101 --cpulimit 25 --save | ||
</pre> | </pre> | ||
− | says that container 101 cannot ever have more than 25 percent of | + | says that container 101 cannot ever have more than 25 percent of the cpu even if the cpu is idle for the other 75% of the time. |
− | |||
− | |||
− | |||
− | |||
− | + | {{Stub}} | |
[[Category: Troubleshooting]] | [[Category: Troubleshooting]] |