首页 » 运维 » 基本知识 » 正文

linux 系统调优系列入门 01

1:查看下当前服务器是多少个CPU

top

使用top之后,按下数字1键,这个时候屏幕上就会出现CPU的信息

当然,我们也可以通过如下命令来查看cpu个数

grep -c ^processor /proc/cpuinfo,例如我台式机的话就会显示

8

2:查看本机主机名称及IP地址
hostname

ip addr

3:查看哪些服务已经启动了

systemctl list-units -t service |awk ‘$3==”active”‘

4:停止非必要的服务libvirtd ,smartd ,ModemManager

先查看一下这些服务占用了多少资源

ps aux |head -n1;ps aux|grep -e ‘[l]ibvirtd’ -e ‘[s]martd’ -e ‘[M]odemManager’

systemctl status libvirtd smartd ModemManager

systemctl stop libvirtd smartd ModemManager

systemctl disable libvirtd smartd ModemManager

虚拟机中的这些服务是没有太多用处的,

Zhiming Zhang

Senior devops at Appannie
一个奔跑在运维路上的胖子
Zhiming Zhang

Latest posts by Zhiming Zhang (see all)