查看Linux伺服器的CPU詳細資料

來源:互聯網
上載者:User

標籤:cpu   linux   

查看Linux伺服器的CPU詳細資料


在Linux系統中,CPU的資訊在啟動的過程中被裝載到虛擬目錄/proc下的cpuinfo檔案中,我們可以通過cat /proc/cpuinfo查看如下:


650) this.width=650;" title="clip_image002" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px;" alt="clip_image002" src="http://s3.51cto.com/wyfs02/M00/5D/B4/wKiom1UjRLfhvyybAAGFQw8uJjM157.jpg" border="0" height="355" />


下面我們來分析其中幾個比較重要的指標:

  •  processor 邏輯處理器的id。

  •  physical id 物理封裝的處理器的id。

  •  core id 每個核心的id。

  •  cpu cores 位於相同物理封裝的處理器中的核心數量。

  •  siblings 位於相同物理封裝的處理器中邏輯處理器的數量。


判斷Linux伺服器CPU情況的依據如下:

  •  具有相同core id的CPU是同一個core的超執行緒。(Any cpu with the same core id are hyper-threads in the same core.)

  •  具有相同physical id的CPU是同一個CPU封裝的線程或核心。(Any cpu with the same physical id are threads or cores in the same physical socket.)


物理CPU個數如下所示:

[[email protected] ~]# cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l

1


每個物理CPU中的core個數(即核心數)如下所示:

[[email protected] ~]# cat /proc/cpuinfo | grep "cpu cores" | uniq

cpu cores : 4


邏輯CPU的個數如下所示:

[[email protected] ~]# cat /proc/cpuinfo | grep "processor" | wc -l

8


查看CPU型號:

[DX\[email protected] ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

8 Intel(R) Xeon(R) CPU E31270 @ 3.40GHz


查看當前CPU啟動並執行位元模式:

[DX\[email protected] ~]# getconf LONG_BIT

64


查看CPU是否支援64位計算,lm指long mode:

[DX\[email protected] ~]# cat /proc/cpuinfo | grep flags | grep ‘lm’ | wc –l

8


綜上所述,我的CPU是支援64位計算,運行在64位元模式下,單路四核開啟超執行緒。

本文出自 “SQL Server Deep Dives” 部落格,請務必保留此出處http://ultrasql.blog.51cto.com/9591438/1629503

查看Linux伺服器的CPU詳細資料

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.