標籤: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" />
下面我們來分析其中幾個比較重要的指標:
判斷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詳細資料