一 .查看CPU核数
1查看CPU 物理核数
cat /proc/cpuinfo | grep "physical id" |sort -u | wc -l
2查看CPU 逻辑核数
hadoop@hadoop:~$ cat /proc/cpuinfo | grep "core id" |sort -u | wc -l
二 .top
top -p PID 查看该进程的信息
top
shift+f :进入选项对所有进程按照某个因素(cpu,内存等)排序
1: top内 查看CPU核数(一般都是逻辑核数)
三 内存占用
扫描二维码关注公众号,回复:
2492099 查看本文章
free -h
sznongfu@iZ2zehlhwjhnr93dioubfzZ:~$ free -h
total used free shared buff/cache available
Mem: 7.8G 4.1G 1.5G 1.9M 2.2G 3.4G
Swap: 8.0G 107M 7.9G
看似还剩 available 3.4G
实际是 free + buff/cache = 1.5+2.2 = 3.7G