最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Shell實(shí)現(xiàn)識(shí)別物理cpu個(gè)數(shù)、核心數(shù)

 更新時(shí)間:2014年12月23日 10:49:42   投稿:junjie  
這篇文章主要介紹了Shell實(shí)現(xiàn)識(shí)別物理cpu個(gè)數(shù)、核心數(shù),本文還介紹了判斷是否為超線程的功能,需要的朋友可以參考下

如何識(shí)別物理cpu個(gè)數(shù),幾個(gè)核,是超線程還是多核心

判斷依據(jù):

1.具有相同core id的cpu是同一個(gè)core的超線程。
2.具有相同physical id的cpu是同一顆cpu封裝的線程或者cores。

英文版:

1.Physical id and core id are not necessarily consecutive but they are unique. Any cpu with the same core id are hyperthreads in the same core.
2.Any cpu with the same physical id are threads or cores in the same physical socket.

實(shí)例:

LunarPages的CPU信息:

復(fù)制代碼 代碼如下:

processor        : 0
vendor_id        : GenuineIntel
cpu family        : 15
model                : 4
model name        : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz                : 3000.881
cache size        : 2048 KB
physical id        : 0
siblings        : 2
core id                : 0
cpu cores        : 1
fdiv_bug        : no
hlt_bug                : no
f00f_bug        : no
coma_bug        : no
fpu                : yes
fpu_exception        : yes
cpuid level        : 5
wp                : yes
flags                : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid xtpr
bogomips        : 6006.73
processor        : 1
vendor_id        : GenuineIntel
cpu family        : 15
model                : 4
model name        : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz                : 3000.881
cache size        : 2048 KB
physical id        : 0
siblings        : 2
core id                : 0
cpu cores        : 1
fdiv_bug        : no
hlt_bug                : no
f00f_bug        : no
coma_bug        : no
fpu                : yes
fpu_exception        : yes
cpuid level        : 5
wp                : yes
flags                : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid xtpr
bogomips        : 5999.40
processor        : 2
vendor_id        : GenuineIntel
cpu family        : 15
model                : 4
model name        : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz                : 3000.881
cache size        : 2048 KB
physical id        : 3
siblings        : 2
core id                : 3
cpu cores        : 1
fdiv_bug        : no
hlt_bug                : no
f00f_bug        : no
coma_bug        : no
fpu                : yes
fpu_exception        : yes
cpuid level        : 5
wp                : yes
flags                : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid xtpr
bogomips        : 5999.08
processor        : 3
vendor_id        : GenuineIntel
cpu family        : 15
model                : 4
model name        : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz                : 3000.881
cache size        : 2048 KB
physical id        : 3
siblings        : 2
core id                : 3
cpu cores        : 1
fdiv_bug        : no
hlt_bug                : no
f00f_bug        : no
coma_bug        : no
fpu                : yes
fpu_exception        : yes
cpuid level        : 5
wp                : yes
flags                : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid xtpr
bogomips        : 5999.55

顯示4個(gè)邏輯CPU,通過physical id  ,前面兩個(gè)邏輯cpu的相同,后面兩個(gè)的相同,所以有兩個(gè)物理CPU。前面兩個(gè)的 core id相同,后面的兩個(gè)core ID相同,說明這兩個(gè)CPU都是單核。也就是說兩個(gè)單核cpu,啟用了超線程技術(shù)。

通過intel的cpu的參數(shù)可以初步判斷 使用的是兩個(gè) Xeon奔騰4CPU ,有點(diǎn)差。。。。

如何獲得CPU的詳細(xì)信息:

linux命令:cat /proc/cpuinfo

用命令判斷幾個(gè)物理CPU,幾個(gè)核等:
邏輯CPU個(gè)數(shù):

復(fù)制代碼 代碼如下:

# cat /proc/cpuinfo | grep “processor” | wc -l

物理CPU個(gè)數(shù):
復(fù)制代碼 代碼如下:

# cat /proc/cpuinfo | grep “physical id” | sort | uniq | wc -l

每個(gè)物理CPU中Core的個(gè)數(shù):
復(fù)制代碼 代碼如下:

# cat /proc/cpuinfo | grep “cpu cores” | wc -l

是否為超線程?

如果有兩個(gè)邏輯CPU具有相同的”core id”,那么超線程是打開的。
每個(gè)物理CPU中邏輯CPU(可能是core, threads或both)的個(gè)數(shù):

復(fù)制代碼 代碼如下:

# cat /proc/cpuinfo | grep “siblings”

其他特征:

目前intel新的多核心cpu都會(huì)在后面顯示具體的型號(hào)數(shù)字,例如:

復(fù)制代碼 代碼如下:

model name        : Intel(R) Xeon(R) CPU           X3230  @ 2.66GHz

說明是 Xeon 3230的cpu,而不顯示型號(hào)的具體數(shù)字的,大部分都是奔騰的CPU
很多主機(jī)商都騙人,用奔騰的cpu,卻說是多核心的CPU。

探針看到的數(shù)據(jù):

類型:Intel(R) Xeon(TM) CPU 2.80GHz 緩存:1024 KB
類型:Intel(R) Xeon(TM) CPU 2.80GHz 緩存:1024 KB
類型:Intel(R) Xeon(TM) CPU 2.80GHz 緩存:1024 KB
類型:Intel(R) Xeon(TM) CPU 2.80GHz 緩存:1024 KB

沒有具體的型號(hào),緩存1M,一般都是奔騰系列的cpu,或者是intel假雙核的cpu,具體要根據(jù)上面說的去判斷。新的多核心cpu都能看到具體的型號(hào)。

另外多核心的xeon的CPU,一般主頻都不高,達(dá)到2.8和3.0的只有很少的幾個(gè)高端CPU型號(hào),一般主機(jī)商不會(huì)用這么好的

相關(guān)文章

  • Shell編程中Shift的用法小結(jié)

    Shell編程中Shift的用法小結(jié)

    本文給大家分享Shell編程中Shift的用法小結(jié),文末文給大家擴(kuò)展介紹Shell grep 命令擴(kuò)展增強(qiáng)問題分析,感興趣的朋友跟隨小編一起看看吧
    2021-07-07
  • Linux查看端口占用lsof -i:port的方法

    Linux查看端口占用lsof -i:port的方法

    下面小編就為大家?guī)硪黄狶inux查看端口占用lsof -i:port的方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-08-08
  • Log4j 日志文件Linux/Mac/Windows通用存放位置設(shè)置方法

    Log4j 日志文件Linux/Mac/Windows通用存放位置設(shè)置方法

    下面小編就為大家?guī)硪黄狶og4j 日志文件Linux/Mac/Windows通用存放位置設(shè)置方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-01-01
  • mac使用Shell(終端)SSH連接遠(yuǎn)程服務(wù)器的方法

    mac使用Shell(終端)SSH連接遠(yuǎn)程服務(wù)器的方法

    這篇文章主要介紹了mac使用Shell(終端)SSH連接遠(yuǎn)程服務(wù)器的方法,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-04-04
  • shell腳本for循環(huán)實(shí)現(xiàn)文件和目錄遍歷

    shell腳本for循環(huán)實(shí)現(xiàn)文件和目錄遍歷

    本文主要介紹了shell腳本for循環(huán)實(shí)現(xiàn)文件和目錄遍歷,首先進(jìn)行一個(gè)要遍歷的文件夾,然后循環(huán)查看每個(gè)文件,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-11-11
  • Linux設(shè)置每晚定時(shí)備份Oracle數(shù)據(jù)表的操作命令

    Linux設(shè)置每晚定時(shí)備份Oracle數(shù)據(jù)表的操作命令

    這篇文章主要介紹了Linux設(shè)置每晚定時(shí)備份Oracle數(shù)據(jù)表,本文通過腳本命令給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-12-12
  • Linux命令學(xué)習(xí)之用戶切換su,sudo命令詳解

    Linux命令學(xué)習(xí)之用戶切換su,sudo命令詳解

    在操作過程中需要使用特定的用戶進(jìn)行特定的操作,多數(shù)情況下是因?yàn)闄?quán)限,比如要修改一個(gè)文件,只有root用戶有權(quán)限修改,那么就要切換到root用戶下進(jìn)行操作,本文給大家講解Linux命令學(xué)習(xí)之用戶切換su,sudo命令,感興趣的朋友跟隨小編一起看看吧
    2023-02-02
  • 實(shí)現(xiàn)android自動(dòng)化測(cè)試部署與運(yùn)行Shell腳本分享

    實(shí)現(xiàn)android自動(dòng)化測(cè)試部署與運(yùn)行Shell腳本分享

    這篇文章主要介紹了實(shí)現(xiàn)android自動(dòng)化測(cè)試部署與運(yùn)行Shell腳本分享,本文直接給出實(shí)現(xiàn)代碼,需要的朋友可以參考下
    2015-03-03
  • linux?shell編程指南之字符串與數(shù)組

    linux?shell編程指南之字符串與數(shù)組

    這篇文章主要給大家介紹了關(guān)于linux?shell編程指南之字符串與數(shù)組的相關(guān)資料,字符串與數(shù)組是Shell編程中常用的數(shù)據(jù)類型,文中通過圖文介紹的非常詳細(xì),需要的朋友可以參考下
    2023-06-06
  • crontab設(shè)置每分鐘、每小時(shí)、每天、每周、每月、每年定時(shí)執(zhí)行的腳本

    crontab設(shè)置每分鐘、每小時(shí)、每天、每周、每月、每年定時(shí)執(zhí)行的腳本

    這篇文章主要介紹了crontab設(shè)置每分鐘、每小時(shí)、每天、每周、每月、每年定時(shí)執(zhí)行,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2023-04-04

最新評(píng)論

湛江市| 富平县| 林州市| 临潭县| 弋阳县| 张家川| 汕尾市| 商城县| 嵊州市| 渝中区| 安庆市| 台东县| 佛冈县| 康马县| 米泉市| 台东县| 盐亭县| 中山市| 绍兴县| 元氏县| 登封市| 德阳市| 临沧市| 永仁县| 巫溪县| 乃东县| 辉县市| 体育| 广平县| 弋阳县| 镇康县| 万州区| 民县| 武城县| 海淀区| 安仁县| 邵阳县| 通城县| 新营市| 凤阳县| 温宿县|