當前位置:首頁 » 雲伺服器 » 怎麼查伺服器core數目

怎麼查伺服器core數目

發布時間: 2023-06-03 14:24:20

1. 如何查看linux伺服器的cpu數量,內核數,和cpu線程數

lscpu命令,查看的是cpu的統計信息.
blue@blue-pc:~$ lscpu
Architecture: i686 #cpu架構
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian #小尾序
CPU(s): 4 #總共有4核
On-line CPU(s) list: 0-3
Thread(s) per core: 1 #每個cpu核,只能支持一個線程,即不支持超線程
Core(s) per socket: 4 #每個cpu,有4個核
Socket(s): 1 #總共有1一個cpu
Vendor ID: GenuineIntel #cpu產商 intel
CPU family: 6
Model: 42
Stepping: 7
CPU MHz: 1600.000
BogoMIPS: 5986.12
Virtualization: VT-x #支持cpu虛擬化技術
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 6144K

查看/proc/cpuinfo,可以知道每個cpu信息,如每個CPU的型號,主頻等。
#cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz
.....
上面輸出的是第一個cpu部分信息,還有3個cpu信息省略了。

內存
概要查看內存情況
free -m
total used free shared buffers cached
Mem: 3926 3651 274 0 12 404
-/+ buffers/cache: 3235 691
Swap: 9536 31 9505
這里的單位是MB,總共的內存是3926MB。

查看內存詳細使用
# cat /proc/meminfo
MemTotal: 4020868 kB
MemFree: 230884 kB
Buffers: 7600 kB
Cached: 454772 kB
SwapCached: 836 kB
.....

查看內存硬體信息
dmidecode -t memory
# dmidecode 2.11
SMBIOS 2.7 present.
Handle 0x0008, DMI type 16, 23 bytes
Physical Memory Array
Location: System Board Or Motherboard
....
Maximum Capacity: 32 GB
....
Handle 0x000A, DMI type 17, 34 bytes
....
Memory Device
Array Handle: 0x0008
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 4096 MB
.....
我的主板有4個槽位,只用了一個槽位,上面插了一條4096MB的內存。

磁碟
查看硬碟和分區分布
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├—sda1 8:1 0 1G 0 part /boot
├—sda2 8:2 0 9.3G 0 part [SWAP]
├—sda3 8:3 0 74.5G 0 part /
├—sda4 8:4 0 1K 0 part
├—sda5 8:5 0 111.8G 0 part /home
└—sda6 8:6 0 269.2G 0 part
顯示很直觀

如果要看硬碟和分區的詳細信息
# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00023728
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2148351 1073152 83 Linux
/dev/sda2 2148352 21680127 9765888 82 Linux swap / Solaris
/dev/sda3 21680128 177930239 78125056 83 Linux
/dev/sda4 177932286 976771071 399419393 5 Extended/dev/sda5 177932288 412305407 117186560 83 Linux
/dev/sda6 412307456 976771071 282231808 83 Linux

網卡
查看網卡硬體信息
# lspci | grep -i 'eth'
02:00.0 Ethernet controller: Realtek Semiconctor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)

查看系統的所有網路介面
# ifconfig -a
eth0 Link encap:乙太網 硬體地址 b8:97:5a:17:b3:8f
.....
lo Link encap:本地環回
.....
或者是
ip link show
1: lo: <LOOPBACK> mtu 16436 qdisc noqueue state DOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether b8:97:5a:17:b3:8f brd ff:ff:ff:ff:ff:ff

如果要查看某個網路介面的詳細信息,例如eth0的詳細參數和指標
# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full #支持千兆半雙工,全雙工模式
Supported pause frame use: No
Supports auto-negotiation: Yes #支持自適應模式,一般都支持
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes #默認使用自適應模式
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
.....
Speed: 100Mb/s #現在網卡的速度是100Mb,網卡使用自適應模式,所以推測路由是100Mb,導致網卡從支 持千兆,變成要支持百兆
Duplex: Full #全雙工
.....
Link detected: yes #表示有網線連接,和路由是通的

其他
查看pci信息,即主板所有硬體槽信息。
lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09) #主板晶元
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) #顯卡
00:14.0 USB controller: Intel Corporation Panther Point USB xHCI Host Controller (rev 04) #usb控制器
00:16.0 Communication controller: Intel Corporation Panther Point MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation Panther Point USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation Panther Point High Definition Audio Controller (rev 04) #音效卡
00:1c.0 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 1 (rev c4) #pci 插槽
00:1c.2 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 3 (rev c4)
00:1c.3 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 4 (rev c4)
00:1d.0 USB controller: Intel Corporation Panther Point USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Panther Point LPC Controller (rev 04)
00:1f.2 IDE interface: Intel Corporation Panther Point 4 port SATA Controller [IDE mode] (rev 04) #硬碟介面
00:1f.3 SMBus: Intel Corporation Panther Point SMBus Controller (rev 04)
00:1f.5 IDE interface: Intel Corporation Panther Point 2 port SATA Controller [IDE mode] (rev 04) #硬碟介面
02:00.0 Ethernet controller: Realtek Semiconctor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06) #網卡
03:00.0 PCI bridge: Integrated Technology Express, Inc. Device 8893 (rev 41)
如果要更詳細的信息:lspci -v 或者 lspci -vv
如果要看設備樹:lscpi -t

查看bios信息
# dmidecode -t bios
......
BIOS Information
Vendor: American Megatrends Inc.
Version: 4.6.5
Release Date: 04/25/2012
.......
BIOS Revision: 4.6
......
dmidecode以一種可讀的方式mp出機器的DMI(Desktop Management Interface)信息。這些信息包括了硬體以及BIOS,既可以得到當前的配置,也可以得到系統支持的最大配置,比如說支持的最大內存數等。
如果要查看所有有用信息
dmidecode -q
以上是linux查看硬體信息的所有命令,可以查看CPU、硬碟、網卡、磁碟等硬體的信息。

2. 怎麼查看linux伺服器的cpu信息和核心數

Linux查看CPU基本信息,可以使用命令:
cat /proc/cpuinfo
例如筆者的虛擬機:
[root@promote ~]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 37
model name : Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz
stepping : 5
cpu MHz : 2394.049
cache size : 3072 KB
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc up arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt aes hypervisor lahf_lm ida arat dts
bogomips : 4788.09
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
可見,筆者這台虛擬機,有一個邏輯CPU,主頻是2.4。
延伸:
processor 邏輯處理器的id。
physical id 物理封裝的處理器的id。
core id 每個核心的id。
cpu cores 位於相同物理封裝的處理器中的內核數量。
siblings 位於相同物理封裝的處理器中的邏輯處理器的數量。

# 總核數 = 物理CPU個數 X 每顆物理CPU的核數
# 總邏輯CPU數 = 物理CPU個數 X 每顆物理CPU的核數 X 超線程數
# 查看物理CPU個數
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
# 查看每個物理CPU中core的個數(即核數)
cat /proc/cpuinfo| grep "cpu cores"| uniq
# 查看邏輯CPU的個數
cat /proc/cpuinfo| grep "processor"| wc -l

查看CPU信息(型號)
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

3. 在linux 下怎麼查看伺服器的cpu和內存的硬體信息

可以按照如下方式進行操作:

一、查看cpu總個數方法:

1、首先執行top命令,如下圖中內容所表示。

(3)怎麼查伺服器core數目擴展閱讀

linux通用命令:

1、date :print or set the system date and time
2、stty -a: 可以查看或者列印控制字元(Ctrl-C, Ctrl-D, Ctrl-Z等)
3、passwd: print or set the system date and time (用passwd -h查看)
4、logout, login: 登錄shell的登錄和注銷命令
5、pwd: print working directory

6、more, less, head tail: 顯示或部分顯示文件內容.
7、lp/lpstat/cancel, lpr/lpq/lprm: 列印文件.
8、更改文件許可權: chmod u+x...
9、刪除非空目錄:rm -fr dir
10、拷貝目錄: cp -R dir

4. 查看伺服器CPU顆數怎麼查詢

您好,若您想查看Windows系統的,請參考以下步驟:
·查詢核心線程數量的辦法:
一般地,如果是沒有被軟體修改過參數的話(也就是說是完全真正的原版CPU),那麼在任務管理器-性能-CPU使用記錄(所有CPU一張圖表)中可見
·查詢CPU型號的方法:
一.WinK+R→CMD→回車→dxdiag→確定
二.WinK+Pause(系統屬性)→硬體→設備管理器→處理器
通常CPU的型號就決定了其「核心數」與「線程數」,若您已知型號就好辦了,可以在網上查一下便知,可到zol、it168、pconline等查看
打個比方,你查到的是E5506的CPU,如果顯示出了"8 CPUs",那麼就說明是"兩顆"CPU(即雙路的E5506),依此類推,祝好

5. linux 物理cpu、cpu核數、邏輯cpu

在linux系統中,提供了 proc系統 顯示系統的軟硬體信息,可以使用命令 cat /proc/cpuinfo 來查看

1. 查看物理CPU(機器的主板上實際插入插槽的 CPU )個數
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l

2. 查看每個物理CPU中core的個數(即核數(單塊 CPU 上面能處理數據的晶元組的數量,如雙核、四核等 (cpu cores 核心)))
cat /proc/cpuinfo| grep "cpu cores"| uniq

3. 查看邏輯CPU(決定了伺服器並行(同時)處理任務的能力)的個數
cat /proc/cpuinfo| grep "processor"| wc -l

熱點內容
在系統編程 發布:2024-04-19 08:54:55 瀏覽:234
visualstudio反編譯 發布:2024-04-19 08:44:46 瀏覽:319
ise怎麼配置晶元 發布:2024-04-19 08:27:31 瀏覽:997
免費搭建在線查詢伺服器 發布:2024-04-19 08:17:28 瀏覽:46
vs資料庫實例 發布:2024-04-19 08:14:54 瀏覽:295
vfp9反編譯 發布:2024-04-19 08:11:31 瀏覽:381
火車軟卧無線密碼是多少 發布:2024-04-19 07:38:59 瀏覽:423
vb系統文件夾 發布:2024-04-19 07:29:58 瀏覽:740
qt怎麼添加文件夾 發布:2024-04-19 07:22:53 瀏覽:256
sql查詢表是否存在 發布:2024-04-19 06:11:48 瀏覽:623