Linux (check the number of service cpu cores and memory)

The two most important configurations in a linux server are CPU and memory. So how to start checking the number of CPU cores, memory, and usage is the most frequently used operation in daily operation and maintenance.

The easiest command to view the cpu of a linux server is cat /proc/cpuinfo

The easiest command to check the cpu of a linux server is lscpu

View Linux server memory

cat /proc/meminfo

The simplest command to view the memory of a linux server: free -h

lscpu information

[root@tXX-XXX-app logs]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 85
Model name:            Intel(R) Xeon(R) Platinum 8255C CPU @ 2.50GHz
Stepping:              5
CPU MHz:               2494.140
BogoMIPS:              4988.28
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              4096K
L3 cache:              36608K
NUMA node0 CPU(s):     0-3

It can be seen that the architecture of the operating system is an x86 64-bit operating system.

CPU operating model supports 32-bit and 64-bit

byte Order 为 Little Endian

The number of cpu cores is 4 cores

The main frequency of the CPU is 2.50GHZ

The CPU cache is a level 4 cache, respectively 32k 32k 4096K 36608K

free -h memory information

[root@tXX-XXX-app logs]# free  -h
              total        used        free      shared  buff/cache   available
Mem:            15G        6.2G        266M        1.1M        8.7G        8.7G
Swap:            0B          0B          0B

Total memory 15G 6.2G used 8.7G available

Disk information du -h /home View the disk space occupied by each folder in the home directory.

[root@tXX-XX-app logs]# du -h  /home
44M     /home/docker/apps/eureka
8.0K    /home/docker/apps/nginx/conf.d/bak_20230227
16K     /home/docker/apps/nginx/conf.d
8.0K    /home/docker/apps/nginx/conf/bak_20230227
24K     /home/docker/apps/nginx/conf
29M     /home/docker/apps/nginx/www/ctg-member/ctg-member/assets
30M     /home/docker/apps/nginx/www/ctg-member/ctg-member
30M     /home/docker/apps/nginx/www/ctg-member
30M     /home/docker/apps/nginx/www
12G     /home/docker/apps/nginx/logs
20K     /home/docker/apps/nginx/cert
12G     /home/docker/apps/nginx
12G     /home/docker/apps
16K     /home/docker/script/apollo
36K     /home/docker/script
12G     /home/docker
392M    /home/project/ctg-member-plat/jar
8.1M    /home/project/ctg-member-plat/logs
16K     /home/project/ctg-member-plat/script/subscript
28K     /home/project/ctg-member-plat/script
400M    /home/project/ctg-member-plat
52M     /home/project/sso/jar
56K     /home/project/sso/logs
8.0K    /home/project/sso/script
52M     /home/project/sso
451M    /home/project
12K     /home/redis/myredis/data/appendonlydir
16K     /home/redis/myredis/data
24K     /home/redis/myredis
28K     /home/redis
67M     /home/tingyun
13G     /home

Guess you like

Origin blog.csdn.net/dongjing991/article/details/129254608