linux下如何查看服务器的硬件配置信息性能测试时⼀定要确定测试环境和的硬件配置、软件版本配置,保证和线上⼀致,才更接近真实环境。
那么linux下如何查看服务器的硬件配置信息??
⼀、查看cpu信息
1、所有信息 lscpu
[root@redis02 ~]# lscpu
Architecture: x86_64 ##cpu架构
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8 ##总共有8核
On-line CPU(s) list: 0-7
Thread(s) per core: 1 ##每个cpu核,只能⽀持⼀个线程,即不⽀持超线程
Core(s) per socket: 8 ##每个cpu,有8个核
Socket(s): 1 ##总共有1⼀个cpu
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 79
Model name: Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz
Stepping: 1
CPU MHz: 2095.139
BogoMIPS: 4190.27
Hypervisor vendor: Microsoft
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 20480K
NUMA node0 CPU(s): 0-7
2、查看逻辑cpu的数量
cat /proc/cpuinfo |grep "processor"|sort -u|wc -l
3、查看物理cpu的数量
grep "physical id" /proc/cpuinfo|sort -u|wc -l
4、查看每个物理cpu的内核数
grep "cpu cores" /proc/cpuinfo|uniq
5、每个物理CPU上逻辑CPU个数
grep "siblings" /proc/cpuinfo|uniq
6、判断是否开启了抄超线程:
如果多个逻辑CPU的"physical id"和"core id"均相同,说明开启了超线程
或者换句话说
逻辑CPU个数 > 物理CPU个数 * 数开启了超线程
逻辑CPU个数 = 物理CPU个数 * 数没有开启超线程
⼆、查看内存信息
1、free -m
[root@redis02 ~]# free -m
total used free shared buffers cached
Mem: 160718041802901436487
-/+ buffers/cache: 141114659
Swap: 8039368003
2、查看内存详细信息 cat /proc/meminfo
[root@redis02 ~]# cat /proc/meminfo MemTotal: 16456948 kB MemFree: 8222176 kB Buffers: 146532 kB Cached: 6643084 kB SwapCached: 3200 kB Active: 6315476 kB Inactive: 1478136 kB
Active(anon): 338812 kB Inactive(anon): 665832 kB Active(file): 5976664 kB Inactive(file): 812304 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 8232956 kB SwapFree: 8195644 kB Dirty: 16 kB Writeback: 0 kB AnonPages: 1001364 kB Mapped: 14560 kB Shmem: 648 kB
Slab: 283984 kB SReclaimable: 221920 kB SUnreclaim: 62064 kB KernelStack: 5472 kB PageTables: 5952 kBlinux安装redis服务
NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 16461428 kB Committed_AS: 752588 kB VmallocTotal: 34359738367 kB VmallocUsed: 65856 kB VmallocChunk: 34359659968 kB HardwareCorrupted: 0 kB AnonHugePages: 962560 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 14272 kB DirectMap2M: 16762880 kB
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论