查看有多少个CPU
1:top 命令之后,按数字1 键,会显示CPU信息
1 2 3 4 5 6 7 8 9 10 11 12 13 |
top - 09:19:05 up 28 days, 1:18, 6 users, load average: 0.24, 0.19, 0.15 Tasks: 273 total, 1 running, 272 sleeping, 0 stopped, 0 zombie %Cpu0 : 0.7 us, 0.3 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu1 : 0.7 us, 0.0 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu2 : 1.0 us, 0.7 sy, 0.0 ni, 98.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu3 : 23.3 us, 0.3 sy, 0.0 ni, 76.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu4 : 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu5 : 0.3 us, 0.0 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st |
2:
1 |
grep -c ^processor /proc/cpuinfo |
3:lscpu
查看系统主机名称:
1 |
hostname |
查看IP地址:
1 |
ip addr show eth0 |
查看启动的服务:
1 |
systemctl list-units -t service | awk '$3=="active"' |
查看libvirtd, smartd, and ModemManager 相关资源占用信息并停用
1 2 3 4 |
ps aux |head -n1;ps aux|grep -e '[l]ibvirtd' -e '[s]martd' -e '[M]odemManager' systemctl stop libvirtd smartd ModemManager | grep -e Active -e Loaded -e service systemctl disable libvirtd smartd ModemManager systemctl status libvirtd smartd ModemManager | grep -e Active -e Loaded -e service |
为什么要停掉这些呢? 首先, 这是一台虚拟机,所以,很有可能不需要再提供虚拟机服务 ,所以libvirtd 可以认为不再需要,smartd 的作用是从磁盘读取相关数据信息,因为虚拟机的缘故,smartd 可能起不了太大作用,同理, ModemManager 也需要如果机器没有modem的话
Latest posts by Zhiming Zhang (see all)
- aws eks node 自动化扩展工具 Karpenter - 8月 10, 2022
- ReplicationController and ReplicaSet in Kubernetes - 12月 20, 2021
- public key fingerprint - 5月 27, 2021