<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://linux-vserver.org/skins/common/feed.css?303"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Applying CPU Limits - Revision history</title>
		<link>http://linux-vserver.org/index.php?title=Applying_CPU_Limits&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.20.2</generator>
		<lastBuildDate>Sat, 25 May 2013 05:59:16 GMT</lastBuildDate>
		<item>
			<title>Glenn: +cat</title>
			<link>http://linux-vserver.org/index.php?title=Applying_CPU_Limits&amp;diff=4852&amp;oldid=prev</link>
			<guid isPermaLink="false">http://linux-vserver.org/index.php?title=Applying_CPU_Limits&amp;diff=4852&amp;oldid=prev</guid>
			<description>&lt;p&gt;+cat&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 19:08, 21 October 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;But remember that these instructions just cover setting limits in a running vserver. To save the values you choose please refer to the [http://www.nongnu.org/util-vserver/doc/conf/configuration.html great flower page].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;But remember that these instructions just cover setting limits in a running vserver. To save the values you choose please refer to the [http://www.nongnu.org/util-vserver/doc/conf/configuration.html great flower page].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Documentation]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Fri, 21 Oct 2011 19:08:23 GMT</pubDate>			<dc:creator>Glenn</dc:creator>			<comments>http://linux-vserver.org/Talk:Applying_CPU_Limits</comments>		</item>
		<item>
			<title>Bobnormal: /* Kernel config */ zcat &gt; gzip -d</title>
			<link>http://linux-vserver.org/index.php?title=Applying_CPU_Limits&amp;diff=4215&amp;oldid=prev</link>
			<guid isPermaLink="false">http://linux-vserver.org/index.php?title=Applying_CPU_Limits&amp;diff=4215&amp;oldid=prev</guid>
			<description>&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Kernel config: &lt;/span&gt; zcat &amp;gt; gzip -d&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:40, 16 February 2010&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  CONFIG_VSERVER_HARDCPU=y&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  CONFIG_VSERVER_HARDCPU=y&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Note: With newer kernels, the config of the currently running kernel can be found with `&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;cat &lt;/del&gt;/proc/config.gz | &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;gzip -d&lt;/del&gt;`.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Note: With newer kernels, the config of the currently running kernel can be found with `&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;zcat &lt;/ins&gt;/proc/config.gz | &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;grep VSERVER&lt;/ins&gt;`.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Context flag ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Context flag ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Tue, 16 Feb 2010 09:40:03 GMT</pubDate>			<dc:creator>Bobnormal</dc:creator>			<comments>http://linux-vserver.org/Talk:Applying_CPU_Limits</comments>		</item>
		<item>
			<title>217.128.26.129: /* Applying CPU limits */</title>
			<link>http://linux-vserver.org/index.php?title=Applying_CPU_Limits&amp;diff=4105&amp;oldid=prev</link>
			<guid isPermaLink="false">http://linux-vserver.org/index.php?title=Applying_CPU_Limits&amp;diff=4105&amp;oldid=prev</guid>
			<description>&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Applying CPU limits&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 14:17, 3 December 2009&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This is a short summary on how to apply limits. This doesn't cover how to choose the values but just on how to apply the numbers in a running vserver without saving the configuration.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This is a short summary on how to apply limits. This doesn't cover how to choose the values but just on how to apply the numbers in a running vserver without saving the configuration.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; note: you can find soft/hard cpu limit with cgroups for vserver2.3 on [[util-vserver:Cgroups]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Kernel config ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Kernel config ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Thu, 03 Dec 2009 14:17:48 GMT</pubDate>			<dc:creator>217.128.26.129</dc:creator>			<comments>http://linux-vserver.org/Talk:Applying_CPU_Limits</comments>		</item>
		<item>
			<title>76.31.144.66: /* Kernel config */</title>
			<link>http://linux-vserver.org/index.php?title=Applying_CPU_Limits&amp;diff=3619&amp;oldid=prev</link>
			<guid isPermaLink="false">http://linux-vserver.org/index.php?title=Applying_CPU_Limits&amp;diff=3619&amp;oldid=prev</guid>
			<description>&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Kernel config&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 01:33, 27 March 2009&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  # cat /boot/config-blah | grep CONFIG_VSERVER_HARDCPU&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  # cat /boot/config-blah | grep CONFIG_VSERVER_HARDCPU&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  CONFIG_VSERVER_HARDCPU=y&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  CONFIG_VSERVER_HARDCPU=y&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Note: With newer kernels, the config of the currently running kernel can be found with `cat /proc/config.gz | gzip -d`.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Context flag ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Context flag ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Fri, 27 Mar 2009 01:33:12 GMT</pubDate>			<dc:creator>76.31.144.66</dc:creator>			<comments>http://linux-vserver.org/Talk:Applying_CPU_Limits</comments>		</item>
		<item>
			<title>SilvioRhatto: Initial version</title>
			<link>http://linux-vserver.org/index.php?title=Applying_CPU_Limits&amp;diff=3511&amp;oldid=prev</link>
			<guid isPermaLink="false">http://linux-vserver.org/index.php?title=Applying_CPU_Limits&amp;diff=3511&amp;oldid=prev</guid>
			<description>&lt;p&gt;Initial version&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Applying CPU limits =&lt;br /&gt;
&lt;br /&gt;
This is a short summary on how to apply limits. This doesn't cover how to choose the values but just on how to apply the numbers in a running vserver without saving the configuration.&lt;br /&gt;
&lt;br /&gt;
== Kernel config ==&lt;br /&gt;
&lt;br /&gt;
First check whether the kernel is with '''CONFIG_VSERVER_HARDCPU''' enabled:&lt;br /&gt;
 &lt;br /&gt;
   # cat /boot/config-blah | grep CONFIG_VSERVER_HARDCPU&lt;br /&gt;
   CONFIG_VSERVER_HARDCPU=y&lt;br /&gt;
&lt;br /&gt;
== Context flag ==&lt;br /&gt;
&lt;br /&gt;
Then check if the vserver you want to apply limits has the [http://linux-vserver.org/Capabilities_and_Flags#Context_flags_.28cflags.29 sched_hard] context flag enabled by checking the contents of ''/proc/virtual/&amp;lt;xid&amp;gt;/status''. The sched_hard flag is ''0x00000100'', so you have to find this value summed up in the vserver flag (see [http://www.mail-archive.com/vserver@list.linux-vserver.org/msg10448.html this message] for details). If its not enabled, use the following command (more info [http://www.mail-archive.com/vserver@list.linux-vserver.org/msg08385.html here]):&lt;br /&gt;
&lt;br /&gt;
  vattribute --set --xid &amp;lt;xid&amp;gt; --flag sched_hard&lt;br /&gt;
&lt;br /&gt;
== Setting the limits ==&lt;br /&gt;
&lt;br /&gt;
Then you should be able to set the limits with a command like this one (more info [http://oldwiki.linux-vserver.org/vsched+explained here]):&lt;br /&gt;
&lt;br /&gt;
  vsched --xid &amp;lt;xid&amp;gt; --fill-rate &amp;lt;fill-rate&amp;gt; --interval &amp;lt;interval&amp;gt; \&lt;br /&gt;
         --fill-rate2 &amp;lt;fill-rate2&amp;gt; --interval2 &amp;lt;interval2&amp;gt; \&lt;br /&gt;
         --tokens-max &amp;lt;tokens-max&amp;gt; --tokens-min &amp;lt;tokens-min&amp;gt; --idle-time --force &lt;br /&gt;
&lt;br /&gt;
it's important to use the option ''--force'' so the limit is applied at the same time in the cpus. If you want to enable fair share (i.e, idle-time) for the vserver, make sure to use the ''--idle-time'' option at the previous command.&lt;br /&gt;
&lt;br /&gt;
Then you should check at ''/proc/virtual/&amp;lt;xid&amp;gt;/sched'' (more info [http://linux-vserver.org/ProcFS#sched here]). Try a command like&lt;br /&gt;
&lt;br /&gt;
  watch -n1 cat /proc/virtual/&amp;lt;xid&amp;gt;/sched&lt;br /&gt;
&lt;br /&gt;
If the collum &amp;quot;Ticks spent on hold&amp;quot; is greater than zero and the flag &amp;quot;On hold (H) or running (R)&amp;quot; assumes the hold value, then its working :)&lt;br /&gt;
 &lt;br /&gt;
If you want to remove the scheduling, use the command&lt;br /&gt;
&lt;br /&gt;
  vattribute --set --xid &amp;lt;xid&amp;gt; --flag ~sched_hard&lt;br /&gt;
&lt;br /&gt;
But remember that these instructions just cover setting limits in a running vserver. To save the values you choose please refer to the [http://www.nongnu.org/util-vserver/doc/conf/configuration.html great flower page].&lt;/div&gt;</description>
			<pubDate>Sat, 27 Dec 2008 01:02:39 GMT</pubDate>			<dc:creator>SilvioRhatto</dc:creator>			<comments>http://linux-vserver.org/Talk:Applying_CPU_Limits</comments>		</item>
	</channel>
</rss>