[转帖]linux 查看CPU 内存的信息

linux,查看,cpu,内存,信息 · 浏览次数 : 0

小编点评

**排版工具** * lscpu * dmidecode * free **排版指令** * lscpu -a * dmidecode -d FILE * free -b kilo * free -h handle * free -u dump * free -dump_bin FILE * free -from_dump FILE * lscpu -V * free -version

正文

https://bbs.huaweicloud.com/blogs/302929
 
【摘要】 ECS信息规格:2vCPUs | 4GiB | kc1.large.2镜像:openEuler 20.03 64bit with ARM | 公共镜像  linux 查看CPU 内存 硬盘的信息 查看CPU的信息# cat /proc/cpuinfo processor : 0BogoMIPS : 200.00Features : fp asimd evtstrm aes pmull sh...

ECS信息

  • 规格:2vCPUs | 4GiB | kc1.large.2
  • 镜像:openEuler 20.03 64bit with ARM | 公共镜像

linux 查看CPU 内存 硬盘的信息

查看CPU的信息

# cat /proc/cpuinfo 
processor	: 0
BogoMIPS	: 200.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma dcpop asimddp asimdfhm
CPU implementer	: 0x48
CPU architecture: 8
CPU variant	: 0x1
CPU part	: 0xd01
CPU revision	: 0

processor	: 1
BogoMIPS	: 200.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma dcpop asimddp asimdfhm
CPU implementer	: 0x48
CPU architecture: 8
CPU variant	: 0x1
CPU part	: 0xd01
CPU revision	: 0

# lscpu -e
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE    MAXMHZ    MINMHZ
  0    0      0    0 0:0:0:0          yes 2400.0000 2400.0000
  1    0      0    1 1:1:1:0          yes 2400.0000 2400.0000

# dmidecode -t processor
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.

Handle 0x0400, DMI type 4, 48 bytes
Processor Information
	Socket Designation: CPU 0
	Type: Central Processor
	Family: Other
	Manufacturer: QEMU
	ID: 00 00 00 00 00 00 00 00
	Version: 1.0
	Voltage: Unknown
	External Clock: Unknown
	Max Speed: 2000 MHz
	Current Speed: 2000 MHz
	Status: Populated, Enabled
	Upgrade: Other
	L1 Cache Handle: Not Provided
	L2 Cache Handle: Not Provided
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Core Count: 2
	Core Enabled: 2
	Thread Count: 1
	Characteristics: None

# dmidecode -t 4
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.

Handle 0x0400, DMI type 4, 48 bytes
Processor Information
	Socket Designation: CPU 0
	Type: Central Processor
	Family: Other
	Manufacturer: QEMU
	ID: 00 00 00 00 00 00 00 00
	Version: 1.0
	Voltage: Unknown
	External Clock: Unknown
	Max Speed: 2000 MHz
	Current Speed: 2000 MHz
	Status: Populated, Enabled
	Upgrade: Other
	L1 Cache Handle: Not Provided
	L2 Cache Handle: Not Provided
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Core Count: 2
	Core Enabled: 2
	Thread Count: 1
	Characteristics: None

查看内存的信息

# cat /proc/meminfo 
MemTotal:        3048896 kB
MemFree:         1862464 kB
MemAvailable:    2412352 kB
Buffers:           30208 kB
Cached:           829248 kB
SwapCached:            0 kB
Active:           414208 kB
Inactive:         646784 kB
Active(anon):     206656 kB
Inactive(anon):     8000 kB
Active(file):     207552 kB
Inactive(file):   638784 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:              2048 kB
Writeback:             0 kB
AnonPages:        201536 kB
Mapped:           287040 kB
Shmem:             13120 kB
Slab:              56128 kB
SReclaimable:      26496 kB
SUnreclaim:        29632 kB
KernelStack:        9856 kB
PageTables:         9280 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     1524416 kB
Committed_AS:     654080 kB
VmallocTotal:   133009637312 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
Percpu:             1024 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
CmaTotal:         524288 kB
CmaFree:          523776 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:     524288 kB
Hugetlb:               0 kB

# free -h
              total        used        free      shared  buff/cache   available
Mem:          2.9Gi       293Mi       1.8Gi        12Mi       865Mi       2.3Gi
Swap:            0B          0B          0B

# dmidecode -t memory
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.

Handle 0x1000, DMI type 16, 23 bytes
Physical Memory Array
	Location: Other
	Use: System Memory
	Error Correction Type: Multi-bit ECC
	Maximum Capacity: 4 GB
	Error Information Handle: Not Provided
	Number Of Devices: 1

Handle 0x1100, DMI type 17, 40 bytes
Memory Device
	Array Handle: 0x1000
	Error Information Handle: Not Provided
	Total Width: Unknown
	Data Width: Unknown
	Size: 4096 MB
	Form Factor: DIMM
	Set: None
	Locator: DIMM 0
	Bank Locator: Not Specified
	Type: RAM
	Type Detail: Other
	Speed: Unknown
	Manufacturer: QEMU
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Rank: Unknown
	Configured Memory Speed: Unknown
	Minimum Voltage: Unknown
	Maximum Voltage: Unknown
	Configured Voltage: Unknown

帮助文档(部分)

# lscpu --help

Usage:
 lscpu [options]

Display information about the CPU architecture.

Options:
 -a, --all               print both online and offline CPUs (default for -e)
 -b, --online            print online CPUs only (default for -p)
 -B, --bytes             print sizes in bytes rather than in human readable format
 -C, --caches[=<list>]   info about caches in extended readable format
 -c, --offline           print offline CPUs only

......
# free --help

Usage:
 free [options]

Options:
 -b, --bytes         show output in bytes
     --kilo          show output in kilobytes
     --mega          show output in megabytes
     --giga          show output in gigabytes
     --tera          show output in terabytes
     --peta          show output in petabytes
 -k, --kibi          show output in kibibytes

......
# dmidecode --help
Usage: dmidecode [OPTIONS]
Options are:
 -d, --dev-mem FILE     Read memory from device FILE (default: /dev/mem)
 -h, --help             Display this help text and exit
 -q, --quiet            Less verbose output
 -s, --string KEYWORD   Only display the value of the given DMI string
 -t, --type TYPE        Only display the entries of given type
 -H, --handle HANDLE    Only display the entry of given handle
 -u, --dump             Do not decode the entries
     --dump-bin FILE    Dump the DMI data to a binary file
     --from-dump FILE   Read the DMI data from a binary file
     --no-sysfs         Do not attempt to read DMI data from sysfs files
     --compat-uuid      use compat uuid format with 2.6 SMBIOS specification
     --oem-string N     Only display the value of the given OEM string
 -V, --version          Display the version and exit

与[转帖]linux 查看CPU 内存的信息相似的内容:

[转帖]linux 查看CPU 内存的信息

https://bbs.huaweicloud.com/blogs/302929 【摘要】 ECS信息规格:2vCPUs | 4GiB | kc1.large.2镜像:openEuler 20.03 64bit with ARM | 公共镜像 linux 查看CPU 内存 硬盘的信息 查看CPU的信

[转帖]怎么查看Linux服务器硬件信息,这些命令告诉你

https://zhuanlan.zhihu.com/p/144368206 Linux服务器配置文档找不到,你还在为查询Linux服务器硬件信息发愁吗?学会这些命令,让你轻松查看Linux服务器的CPU,内存,硬盘,SN序列号等信息,根本就不用去机房。 一、查看CPU信息 CPU信息常常包括查看C

[转帖] Linux命令拾遗-查看系统信息

https://www.cnblogs.com/codelogs/p/16060714.html 简介# 作为一名程序员,有时需要关注自己的进程运行在什么样的软硬件环境里,比如几核cpu、固态硬盘还是机械硬盘、内核版本多少、Centos还是Ubuntu? 查看硬件信息# Linux里面提供了一系列命

[转帖] Linux命令拾遗-查看系统信息

https://www.cnblogs.com/codelogs/p/16060714.html 简介# 作为一名程序员,有时需要关注自己的进程运行在什么样的软硬件环境里,比如几核cpu、固态硬盘还是机械硬盘、内核版本多少、Centos还是Ubuntu? 查看硬件信息# Linux里面提供了一系列命

[转帖]17 种查看 Linux 物理内存的方法

17 种查看 Linux 物理内存的方法 https://linux.cn/article-10235-1.html 大多数系统管理员在遇到性能问题时会检查 CPU 和内存利用率。Linux 中有许多实用程序可以用于检查物理内存。这些命令有助于我们检查系统中存在的物理内存,还允许用户检查各种方面的内

[转帖]Linux统计/监控工具SAR详细介绍

原文链接: www.jiangxinlingdu.com Linux统计/监控工具SAR详细介绍:要判断一个系统瓶颈问题,有时需要几个 sar 命令选项结合起来使用,例如:怀疑CPU存在瓶颈,可用 sar -u 和 sar -q 等来查看 怀疑内存存在瓶颈,可用 sar -B、sar -r 和 sa

[转帖]Linux查看物理CPU个数、核数、逻辑CPU个数

https://www.cnblogs.com/bugutian/p/6138880.html CPU总核数 = 物理CPU个数 * 每颗物理CPU的核数 总逻辑CPU数 = 物理CPU个数 * 每颗物理CPU的核数 * 超线程数 查看CPU信息(型号) [root@AAA ~]# cat /pro

【转帖】Linux性能优化(十三)——CPU性能测试

一、CPU上下文切换测试场景 使用sysbench模拟多线程调度: sysbench --threads=10 --time=300 threads run 使用vmstat查看CPU上下文切换: cs列上下文切换次数超过150万次。 r列就绪队列长度最大达到8,超过系统CPU的个数4,存在大量的C

[转帖]Linux查看硬件信息超强命令sar,以及可视化工具ksar

https://juejin.cn/post/6947470401135968286 一、概述 sar(System Activity Reporter,系统活动情况报告)是Linux下系统运行状态统计工具,可从多方面对系统的活动进行报告,包括:文件的读写情况、系统调用的使用情况、磁盘I/O、CPU

[转帖]CPU结构对Redis性能的影响

文章系转载,便于分类和归纳,源文地址:https://wangkai.blog.csdn.net/article/details/111571446 CPU的多核架构和多CPU架构都会影响到Redis的性能 CPU架构 多核架构 一个CPU处理器一般有多个运行核心,如何在Linux查看物理CPU个数