<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>/Proc/Cpuinfo on myshell.co.uk</title><link>https://myshell.co.uk/tags//proc/cpuinfo/</link><description>Recent content in /Proc/Cpuinfo on myshell.co.uk</description><generator>Hugo</generator><language>en-gb</language><copyright>© 2012 &lt;a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank"&gt;Some rights reserved&lt;/a&gt;</copyright><lastBuildDate>Tue, 17 Jul 2012 15:51:00 +0100</lastBuildDate><atom:link href="https://myshell.co.uk/tags//proc/cpuinfo/index.xml" rel="self" type="application/rss+xml"/><item><title>How to determine the number of physical CPUs on Linux</title><link>https://myshell.co.uk/blog/how-to-determine-the-number-of-physical-cpus-on-linux/</link><pubDate>Tue, 17 Jul 2012 15:51:00 +0100</pubDate><guid>https://myshell.co.uk/blog/how-to-determine-the-number-of-physical-cpus-on-linux/</guid><description>&lt;p&gt;The &lt;strong&gt;/proc/cpuinfo&lt;/strong&gt; file contains information about the CPUs installed on your computer however it’s quite confusing when you have to deal with multi-core processors.&lt;/p&gt;
&lt;h4 id="--list-number-of-physical-cpus"&gt;- list number of physical CPUs:&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; cat /proc/cpuinfo &lt;span class="p"&gt;|&lt;/span&gt; grep &lt;span class="s2"&gt;&amp;#34;physical id&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; sort &lt;span class="p"&gt;|&lt;/span&gt; uniq &lt;span class="p"&gt;|&lt;/span&gt; wc -l
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;1
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="--number-of-cores"&gt;- number of cores:&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; cat /proc/cpuinfo &lt;span class="p"&gt;|&lt;/span&gt; grep &lt;span class="s2"&gt;&amp;#34;cpu cores&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; uniq
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;cpu cores : 2
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="--how-many-virtual-processors"&gt;- how many virtual processors:&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; cat /proc/cpuinfo &lt;span class="p"&gt;|&lt;/span&gt; grep &lt;span class="s2"&gt;&amp;#34;^processor&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;processor : 0
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;processor : 1
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the number of virtual processors is greater than the number of physical processors, the CPUs are using hyper-threading. Hyper-threading will only work with the SMP kernel.&lt;/p&gt;</description></item></channel></rss>