<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Linux Setting processor affinity for a certain task or process</title> <atom:link href="http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html</link> <description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description> <lastBuildDate>Fri, 10 Feb 2012 20:37:43 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Cyenne</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-179041</link> <dc:creator>Cyenne</dc:creator> <pubDate>Tue, 07 Feb 2012 08:38:27 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-179041</guid> <description>Hi Tony,I have a CentOS 5.7 w/ cPanel 11.30 + ngxcinp plugin. I want to move over to CloudLinux + LiteSpeed. What would you suggest me:a) setup a new server with CentOS 6 -&gt; Install cPanel -&gt; Move customers over -&gt; Upgrade to CloudLinux 6 orb) stay with CentOS 5.7 and upgrade to CloudLinux directly from there?I&#8217;ve read that theres no upgrade path between RHEL5 -&gt; RHEL6 and as such nor for CentOS or CloudLinux. Which version do you run on your servers? 5.x or 6.x?Thanks in advance</description> <content:encoded><![CDATA[<p>Hi Tony,I have a CentOS 5.7 w/ cPanel 11.30 + ngxcinp plugin. I want to move over to CloudLinux + LiteSpeed. What would you suggest me:a) setup a new server with CentOS 6 -&gt; Install cPanel -&gt; Move customers over -&gt; Upgrade to CloudLinux 6 orb) stay with CentOS 5.7 and upgrade to CloudLinux directly from there?I&#8217;ve read that theres no upgrade path between RHEL5 -&gt; RHEL6 and as such nor for CentOS or CloudLinux. Which version do you run on your servers? 5.x or 6.x?Thanks in advance</p> ]]></content:encoded> </item> <item><title>By: JM</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-173068</link> <dc:creator>JM</dc:creator> <pubDate>Fri, 05 Aug 2011 13:23:34 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-173068</guid> <description>I hawe quad core cpu, and if i want to all linux processes use only 2 cores? What is the right syntax?
Now i have in /etc/init.d/rcS:
&lt;pre&gt;
/usr/bin/taskset -p 1 1
/usr/bin/taskset -p 1 $$
&lt;/pre&gt;
this sett all proccess to first core, but now i want alocate 2 cores for all proccess</description> <content:encoded><![CDATA[<p>I hawe quad core cpu, and if i want to all linux processes use only 2 cores? What is the right syntax?<br
/> Now i have in /etc/init.d/rcS:</p><pre>
/usr/bin/taskset -p 1 1
/usr/bin/taskset -p 1 $$
</pre><p>this sett all proccess to first core, but now i want alocate 2 cores for all proccess</p> ]]></content:encoded> </item> <item><title>By: Anderson</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-172153</link> <dc:creator>Anderson</dc:creator> <pubDate>Mon, 27 Jun 2011 13:15:44 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-172153</guid> <description>Thanks nixcraft!
Very useful!
Congrats!</description> <content:encoded><![CDATA[<p>Thanks nixcraft!<br
/> Very useful!<br
/> Congrats!</p> ]]></content:encoded> </item> <item><title>By: sobrier</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-158230</link> <dc:creator>sobrier</dc:creator> <pubDate>Wed, 21 Jul 2010 08:27:44 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-158230</guid> <description>Hi,
Could you tell how you change proc affinity, I have found a long time.
Thank you.</description> <content:encoded><![CDATA[<p>Hi,<br
/> Could you tell how you change proc affinity, I have found a long time.<br
/> Thank you.</p> ]]></content:encoded> </item> <item><title>By: kannan</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-151549</link> <dc:creator>kannan</dc:creator> <pubDate>Mon, 09 Nov 2009 09:41:05 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-151549</guid> <description>taskset -p option pid
option 1 means 1st processor
option 2 means 2nd processor
option 0xffffffff means all the processor</description> <content:encoded><![CDATA[<p>taskset -p option pid<br
/> option 1 means 1st processor<br
/> option 2 means 2nd processor<br
/> option 0xffffffff means all the processor</p> ]]></content:encoded> </item> <item><title>By: JuanPablo</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-151531</link> <dc:creator>JuanPablo</dc:creator> <pubDate>Sun, 08 Nov 2009 02:03:32 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-151531</guid> <description>how asign a processor to specific user ?
many thanks.</description> <content:encoded><![CDATA[<p>how asign a processor to specific user ?</p><p>many thanks.</p> ]]></content:encoded> </item> <item><title>By: chango</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-151139</link> <dc:creator>chango</dc:creator> <pubDate>Thu, 22 Oct 2009 04:56:43 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-151139</guid> <description>I hava a proccess with forks, child process will have the same affinity ??.
Thanks :D</description> <content:encoded><![CDATA[<p>I hava a proccess with forks, child process will have the same affinity ??.</p><p>Thanks :D</p> ]]></content:encoded> </item> <item><title>By: mahes</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-150658</link> <dc:creator>mahes</dc:creator> <pubDate>Tue, 15 Sep 2009 12:03:25 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-150658</guid> <description>kool stuff - it helped me a lot .thankx in advance
i am in need of running a  application  wit the same cofnfig file , but in different processor .
even though i run both pairs in different proccessor (as per ur taskset commands) . both are crashin in the sense if i change something in 1 pair it gets reflected in other..can t they be prevented.
pls help me throu</description> <content:encoded><![CDATA[<p>kool stuff &#8211; it helped me a lot .thankx in advance<br
/> i am in need of running a  application  wit the same cofnfig file , but in different processor .<br
/> even though i run both pairs in different proccessor (as per ur taskset commands) . both are crashin in the sense if i change something in 1 pair it gets reflected in other..can t they be prevented.</p><p>pls help me throu</p> ]]></content:encoded> </item> <item><title>By: Bernardo B.L.</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-147734</link> <dc:creator>Bernardo B.L.</dc:creator> <pubDate>Wed, 18 Mar 2009 15:42:42 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-147734</guid> <description>Just found the solution
ps -eo psr,pid
this gives the processor in each the pid is current assigned to.</description> <content:encoded><![CDATA[<p>Just found the solution<br
/> ps -eo psr,pid</p><p>this gives the processor in each the pid is current assigned to.</p> ]]></content:encoded> </item> <item><title>By: Bernardo B.L.</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-147733</link> <dc:creator>Bernardo B.L.</dc:creator> <pubDate>Wed, 18 Mar 2009 15:29:14 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-147733</guid> <description>Nixcraft,
This was a very helpful post. It solved part of my problems. But I still have another problem:
How do I know in each processor a current process is running into.
For instance I have a quadcore machine and want to know if the process with pid 999 is running in the cpu 0, 1, 2 or 3.
top command shows only the processor average utilization by this pid but don&#039;t show each cpu is this.
Taskset let me bound a task to a CPU, but yet i don&#039;t know each cpu this process was previously running into.
thanks</description> <content:encoded><![CDATA[<p>Nixcraft,</p><p>This was a very helpful post. It solved part of my problems. But I still have another problem:<br
/> How do I know in each processor a current process is running into.<br
/> For instance I have a quadcore machine and want to know if the process with pid 999 is running in the cpu 0, 1, 2 or 3.<br
/> top command shows only the processor average utilization by this pid but don&#8217;t show each cpu is this.<br
/> Taskset let me bound a task to a CPU, but yet i don&#8217;t know each cpu this process was previously running into.</p><p>thanks</p> ]]></content:encoded> </item> <item><title>By: Jakob Engblom</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-146965</link> <dc:creator>Jakob Engblom</dc:creator> <pubDate>Wed, 28 Jan 2009 20:55:34 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-146965</guid> <description>What are the key guts needed to make this work? I want to put this into a busybox-based embedded system... where apt-get won&#039;t help me at all. I need to statically get it compiled onto the never-changing initrd...</description> <content:encoded><![CDATA[<p>What are the key guts needed to make this work? I want to put this into a busybox-based embedded system&#8230; where apt-get won&#8217;t help me at all. I need to statically get it compiled onto the never-changing initrd&#8230;</p> ]]></content:encoded> </item> <item><title>By: reavers</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-146570</link> <dc:creator>reavers</dc:creator> <pubDate>Mon, 05 Jan 2009 15:37:12 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-146570</guid> <description>How you can unbind a process from the selected processor affinity?
I mean, if you don&#039;t want keep the affinity on a process all time, how can you unbind the established affinity between the processor and the process?
Something like:
taskset -c -p Idprocess?
or
taskset -c * -p Idprocess?
or
taskset -c 0,1,2,3 -p Idprocess?</description> <content:encoded><![CDATA[<p>How you can unbind a process from the selected processor affinity?<br
/> I mean, if you don&#8217;t want keep the affinity on a process all time, how can you unbind the established affinity between the processor and the process?<br
/> Something like:<br
/> taskset -c -p Idprocess?<br
/> or<br
/> taskset -c * -p Idprocess?<br
/> or<br
/> taskset -c 0,1,2,3 -p Idprocess?</p> ]]></content:encoded> </item> <item><title>By: Ankit Singh</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-146245</link> <dc:creator>Ankit Singh</dc:creator> <pubDate>Mon, 15 Dec 2008 09:06:41 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-146245</guid> <description>Ramanath
when you run the command
ankit@hover2:~$ taskset -c -p 0 6369
pid 6369&#039;s current affinity list: 0,1
pid 6369&#039;s new affinity list: 0
0 &amp; 1 is the two cores of my dual core CPU which I changed the affinity to core 0. The above mesg. clearly shows the the affinity was changed to core 0 from core 0,1.
A great article. Keep it up.
Ankit Singh</description> <content:encoded><![CDATA[<p>Ramanath<br
/> when you run the command<br
/> ankit@hover2:~$ taskset -c -p 0 6369<br
/> pid 6369&#8242;s current affinity list: 0,1<br
/> pid 6369&#8242;s new affinity list: 0</p><p>0 &amp; 1 is the two cores of my dual core CPU which I changed the affinity to core 0. The above mesg. clearly shows the the affinity was changed to core 0 from core 0,1.</p><p>A great article. Keep it up.</p><p>Ankit Singh</p> ]]></content:encoded> </item> <item><title>By: Thiru</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-146186</link> <dc:creator>Thiru</dc:creator> <pubDate>Fri, 12 Dec 2008 00:46:57 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-146186</guid> <description>This is very cool!
One question though: Once you bind a process to certain processors,  are those processors dedicated for this process alone? Do other processes use these processors?</description> <content:encoded><![CDATA[<p>This is very cool!<br
/> One question though: Once you bind a process to certain processors,  are those processors dedicated for this process alone? Do other processes use these processors?</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-145530</link> <dc:creator>vivek</dc:creator> <pubDate>Sat, 08 Nov 2008 16:03:12 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-145530</guid> <description>Angelina,
Try following for 2 cpu
&lt;code&gt;taskset -c 0,1 /etc/init.d/oracle-xe start&lt;/code&gt;
OR
&lt;code&gt;su - oracle
taskset -c 0,1 lsnrctl start
taskset -c 0,1 dbstart&lt;/code&gt;
OR
&lt;code&gt;taskset -c 0,1 sqlplus &#039;/ as sysdba&#039;&lt;/code&gt;
And at SQL prompt type:
&lt;code&gt;startup&lt;/code&gt;
HTH</description> <content:encoded><![CDATA[<p>Angelina,</p><p>Try following for 2 cpu<br
/> <code>taskset -c 0,1 /etc/init.d/oracle-xe start</code><br
/> OR<br
/> <code>su - oracle<br
/> taskset -c 0,1 lsnrctl start<br
/> taskset -c 0,1 dbstart</code></p><p>OR<br
/> <code>taskset -c 0,1 sqlplus '/ as sysdba'</code><br
/> And at SQL prompt type:<br
/> <code>startup</code></p><p>HTH</p> ]]></content:encoded> </item> <item><title>By: Angelina</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-145529</link> <dc:creator>Angelina</dc:creator> <pubDate>Sat, 08 Nov 2008 14:17:11 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-145529</guid> <description>Hi,
How to use task set before the process started?
Example: when I start oracle db, I want to use only 2 CPU2 for oracle DB processes. In this point I do not know what is PID.
Oracle says, if you use 4 CPUs at ANY point of time, you should pay oracle license for 4 CPUs.
Please help me ... I do not want to setup kernel maxcpus parameter because I will loose CPUs ...I want to use them for some other processes.
Regards,
Angelina</description> <content:encoded><![CDATA[<p>Hi,</p><p>How to use task set before the process started?</p><p>Example: when I start oracle db, I want to use only 2 CPU2 for oracle DB processes. In this point I do not know what is PID.</p><p>Oracle says, if you use 4 CPUs at ANY point of time, you should pay oracle license for 4 CPUs.</p><p>Please help me &#8230; I do not want to setup kernel maxcpus parameter because I will loose CPUs &#8230;I want to use them for some other processes.</p><p>Regards,<br
/> Angelina</p> ]]></content:encoded> </item> <item><title>By: franchisu</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-144500</link> <dc:creator>franchisu</dc:creator> <pubDate>Tue, 29 Jul 2008 14:35:11 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-144500</guid> <description>Actually, it evidently works especially when I set a process&#039; affinity before running the process. I noticed that while running a cpu or memory intensive task such as Virtual box or VMware, alternating/changing processor affinity doesn&#039;t seem as evident as my previous example. Anyone noticed this? Perhaps it has something to do with the Linux kernel overriding the manual affinity changing since the kernel knows how to better handle processes and it probably knows that there will be performance hits when moving processes such as VMware/Virtualbox from one proc to another (e.g. cache hit rate etc) ?</description> <content:encoded><![CDATA[<p>Actually, it evidently works especially when I set a process&#8217; affinity before running the process. I noticed that while running a cpu or memory intensive task such as Virtual box or VMware, alternating/changing processor affinity doesn&#8217;t seem as evident as my previous example. Anyone noticed this? Perhaps it has something to do with the Linux kernel overriding the manual affinity changing since the kernel knows how to better handle processes and it probably knows that there will be performance hits when moving processes such as VMware/Virtualbox from one proc to another (e.g. cache hit rate etc) ?</p> ]]></content:encoded> </item> <item><title>By: anuu</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-144499</link> <dc:creator>anuu</dc:creator> <pubDate>Tue, 29 Jul 2008 14:19:44 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-144499</guid> <description>anu@el[~]$ taskset -c -p 1 11574
pid 11574&#039;s current affinity list: 0,1
pid 11574&#039;s new affinity list: 1
it works to me
debian etch
great tool to look what proceses are running is
htop</description> <content:encoded><![CDATA[<p>anu@el[~]$ taskset -c -p 1 11574<br
/> pid 11574&#8242;s current affinity list: 0,1<br
/> pid 11574&#8242;s new affinity list: 1</p><p>it works to me<br
/> debian etch</p><p>great tool to look what proceses are running is<br
/> htop</p> ]]></content:encoded> </item> <item><title>By: franchisu</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-144292</link> <dc:creator>franchisu</dc:creator> <pubDate>Sun, 06 Jul 2008 03:53:41 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-144292</guid> <description>hi guys,
I tried using taskset and schedtool interchangeably, and I noticed that when I&#039;m running virtualbox, which is a cpu intensive process, then I change proc affinity which doesn&#039;t seem to have that big an effect in &#039;top&#039;. I change from one proc to another and the output of &#039;top&#039; seems unchanged, while the process is already running. However, if I begin a new cpu intensive process and assign it an affinity before running it, then I can see changes in the output of &#039;top&#039;. any clues to this? perhaps my already running virtualbox is too &#039;attached&#039; to its original proc that the linux kernel decides to override/not pay attention to my schedtool/taskset commands?</description> <content:encoded><![CDATA[<p>hi guys,<br
/> I tried using taskset and schedtool interchangeably, and I noticed that when I&#8217;m running virtualbox, which is a cpu intensive process, then I change proc affinity which doesn&#8217;t seem to have that big an effect in &#8216;top&#8217;. I change from one proc to another and the output of &#8216;top&#8217; seems unchanged, while the process is already running. However, if I begin a new cpu intensive process and assign it an affinity before running it, then I can see changes in the output of &#8216;top&#8217;. any clues to this? perhaps my already running virtualbox is too &#8216;attached&#8217; to its original proc that the linux kernel decides to override/not pay attention to my schedtool/taskset commands?</p> ]]></content:encoded> </item> <item><title>By: InQuest</title><link>http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-143698</link> <dc:creator>InQuest</dc:creator> <pubDate>Tue, 06 May 2008 23:07:19 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html#comment-143698</guid> <description>Does the taskset do its job on already running processes. I tried but it didn&#039;t work. First I ran 2 identical processes without taskset. They were homogeneously running on all 8 cpus I had. Now, when I tried assigning 2 cpus to 1 and 6 to another, it didn&#039;t work.
I killed the process where I assigned 6 cpus. Still the other was using all 8 cpus.</description> <content:encoded><![CDATA[<p>Does the taskset do its job on already running processes. I tried but it didn&#8217;t work. First I ran 2 identical processes without taskset. They were homogeneously running on all 8 cpus I had. Now, when I tried assigning 2 cpus to 1 and 6 to another, it didn&#8217;t work.<br
/> I killed the process where I assigned 6 cpus. Still the other was using all 8 cpus.</p> ]]></content:encoded> </item> </channel> </rss>
