<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://linux-vserver.at/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://linux-vserver.at/index.php?action=history&amp;feed=atom&amp;title=Applying_CPU_Limits</id>
		<title>Applying CPU Limits - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://linux-vserver.at/index.php?action=history&amp;feed=atom&amp;title=Applying_CPU_Limits"/>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Applying_CPU_Limits&amp;action=history"/>
		<updated>2026-04-09T15:48:29Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.2</generator>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Applying_CPU_Limits&amp;diff=4852&amp;oldid=prev</id>
		<title>Glenn: +cat</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Applying_CPU_Limits&amp;diff=4852&amp;oldid=prev"/>
				<updated>2011-10-21T19:08:23Z</updated>
		
		<summary type="html">&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;</summary>
		<author><name>Glenn</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Applying_CPU_Limits&amp;diff=4215&amp;oldid=prev</id>
		<title>Bobnormal: /* Kernel config */ zcat &gt; gzip -d</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Applying_CPU_Limits&amp;diff=4215&amp;oldid=prev"/>
				<updated>2010-02-16T09:40:03Z</updated>
		
		<summary type="html">&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;</summary>
		<author><name>Bobnormal</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Applying_CPU_Limits&amp;diff=4105&amp;oldid=prev</id>
		<title>217.128.26.129: /* Applying CPU limits */</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Applying_CPU_Limits&amp;diff=4105&amp;oldid=prev"/>
				<updated>2009-12-03T14:17:48Z</updated>
		
		<summary type="html">&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;</summary>
		<author><name>217.128.26.129</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Applying_CPU_Limits&amp;diff=3619&amp;oldid=prev</id>
		<title>76.31.144.66: /* Kernel config */</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Applying_CPU_Limits&amp;diff=3619&amp;oldid=prev"/>
				<updated>2009-03-27T01:33:12Z</updated>
		
		<summary type="html">&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;</summary>
		<author><name>76.31.144.66</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Applying_CPU_Limits&amp;diff=3511&amp;oldid=prev</id>
		<title>SilvioRhatto: Initial version</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Applying_CPU_Limits&amp;diff=3511&amp;oldid=prev"/>
				<updated>2008-12-27T01:02:39Z</updated>
		
		<summary type="html">&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;</summary>
		<author><name>SilvioRhatto</name></author>	</entry>

	</feed>