Linux server information query command

2 physical CPUs, 12 cores and 48 threads

查看物理CPU个数
    (venv2) LIST_2080Ti@ubuntu-SYS-7049GP-TRT:~$ cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
2
查看每个物理CPU的核数
    (venv2) LIST_2080Ti@ubuntu-SYS-7049GP-TRT:~$ cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores       : 12
查看逻辑CPU个数(线程)
    (venv2) LIST_2080Ti@ubuntu-SYS-7049GP-TRT:~$ cat /proc/cpuinfo| grep "processor"| wc -l
48
查看具体CPU数
    (venv2) LIST_2080Ti@ubuntu-SYS-7049GP-TRT:~$ cat /proc/cpuinfo| grep "physical id"| sort| uniq
physical id     : 0
physical id     : 1
查看CPU信息
    cat /proc/cpuinfo
查看内存信息
    cat /proc/meminfo
查看CPU型号
    (venv2) LIST_2080Ti@ubuntu-SYS-7049GP-TRT:~$ cat /proc/cpuinfo | grep name | sort | uniq
model name      : Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz

Or check directly like this:

lscpu

Use the linux top command to view core usage

top - 22:31:54 up 30 days, 20:52,  3 users,  load average: 4.89, 4.76, 4.74
Tasks: 910 total,   2 running, 907 sleeping,   0 stopped,   1 zombie
%Cpu(s):  9.9 us,  1.5 sy,  0.0 ni, 88.6 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem : 257575.3 total,  22421.6 free, 118739.3 used, 116414.3 buff/cache
MiB Swap:   2048.0 total,   2010.7 free,     37.2 used. 136199.8 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                        
3310303 LIST_20+  20   0   55.6g  28.5g 539232 S 147.0  11.3   1114:26 python                                                         
3310418 LIST_20+  20   0   54.1g  27.0g 540144 S 143.1  10.7   1131:21 python                                                         
3310518 LIST_20+  20   0   52.0g  25.3g 544500 S 141.8  10.0   1131:05 python                                                         
3310011 LIST_20+  20   0   57.6g  30.6g 541192 R  99.3  12.2   1099:30 python                                                         
3299063 LIST_20+  20   0   12784   4768   3116 S   1.3   0.0  10:30.50 top                                                            
3321730 LIST_20+  20   0   12680   4844   3248 R   1.0   0.0   0:00.75 top                                                            
3214837 LIST_20+  20   0  973100  62688  33612 S   0.7   0.0   1:08.64 node                                                           
3214799 LIST_20+  20   0 1331592 496620  36356 S   0.3   0.2   8:50.24 node                                                           
3219854 LIST_20+  20   0   11.3g 573292  39928 S   0.3   0.2   6:55.66 node                                                           
3292017 root      20   0       0      0      0 I   0.3   0.0   0:18.21 kworker/22:1-events                                            
3317425 root      20   0       0      0      0 I   0.3   0.0   0:04.74 kworker/15:1-events                                            
3318410 root      20   0       0      0      0 I   0.3   0.0   0:01.62 kworker/14:1-events                                            
3320904 root      20   0       0      0      0 I   0.3   0.0   0:00.21 kworker/u96:2-poll_megasas0_status                             
      1 root      20   0  169796  13084   8296 S   0.0   0.0   2:21.74 systemd                                                        
      2 root      20   0       0      0      0 S   0.0   0.0   0:01.22 kthreadd                                                       
      3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_gp                                                         
      4 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_par_gp                                                     
      5 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 slub_flushwq                                                   
      6 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 netns                                                          
      8 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kworker/0:0H-events_highpri   

The meaning of the parameters in the first paragraph of top is as follows:

List Field Meaning

More explanation: Detailed explanation of Linux top command: Continuously monitor the running status of the process

 reference:

How does Linux check the number of CPU cores? -Linux operation and maintenance-PHP Chinese Network

Linux server's physical CPU, CPU core number, logical CPU and Hadoop's Vcore_Data_IT_Farmer's Blog-CSDN Blog

 

Guess you like

Origin blog.csdn.net/a1456123a/article/details/129005115