linux--cpu相关命令

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wwzhang0307/article/details/52396363

lscpu -ae #产看cpu核心数和各级缓存对应的关系

[root@jzinfo-test txt]# lscpu -ae
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE
0   0    0      0    0:0:0:0       yes
1   0    0      1    1:1:1:0       yes
2   0    0      0    0:0:0:0       yes
3   0    0      1    1:1:1:0       yes

top查找nginx进程绑定cpu的core

top–>按u 输入nobody(筛选出工作进程)–>按f 添加一列 j列–> shift+f 按照某一列排序

Tasks: 595 total,   1 running, 594 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.5%us,  0.8%sy,  0.0%ni, 97.2%id,  0.1%wa,  0.0%hi,  0.4%si,  0.0%st
Mem:  65865756k total, 44009036k used, 21856720k free,   172908k buffers
Swap: 54956028k total,        0k used, 54956028k free, 41529096k cached

USER      PR    PID  NI  RES  SHR S %CPU  VIRT %MEM    TIME+   P COMMAND                                  
nobody    20  83927   0  14m 1596 S 13.5 81684  0.0   4:40.68 16 nginx                                     
nobody    20  83926   0  13m 1596 S 13.9 80308  0.0   3:39.27 17 nginx                                     
nobody    20  83925   0  13m 1596 S 12.9 80092  0.0   3:32.92 18 nginx                                     
nobody    20  83924   0  12m 1596 S  9.9 79108  0.0   2:24.36 19 nginx                                     
nobody    20  83923   0  12m 1596 S  6.9 79276  0.0   1:56.68 20 nginx                                     
nobody    20  83922   0  11m 1596 S  7.9 78780  0.0   2:04.60 21 nginx                                     
nobody    20  83921   0  11m 1596 S  4.3 78860  0.0   1:41.88  6 nginx                                     
nobody    20  83920   0  12m 1596 S  7.3 79308  0.0   2:17.74 23 nginx                                     
nobody    20  83919   0  10m 1492 S  2.3 77600  0.0   0:34.45 24 nginx                                     
nobody    20  83918   0  10m 1580 S  2.3 77440  0.0   0:34.35  9 nginx                                     
nobody    20  83917   0  10m 1456 S  2.0 77440  0.0   0:35.55 26 nginx                                     
nobody    20  83916   0  10m 1516 S  2.6 77440  0.0   0:37.05 11 nginx                                     
nobody    20  83914   0  10m 1532 S  2.0 77624  0.0   0:35.34 12 nginx                                     
nobody    20  83913   0  10m 1432 S  2.3 77368  0.0   0:34.64 13 nginx                                     
nobody    20  83912   0  10m 1464 S  2.3 77440  0.0   0:35.89 14 nginx                                     
nobody    20  83911   0  10m 1456 S  2.3 77440  0.0   0:35.07 15 nginx   
展开阅读全文

没有更多推荐了,返回首页