w - Show who is logged on and what they are doing.
[root@n1 ~]# w # w - Show who is logged on and what they are doing.
10:15:20 up 56 min, 3 users, load average: 0.02, 0.02, 0.05
时间 系统运行时间, 登录用户数,平均负载(单位时间段内CPU活动进程数),不要超过cpu核数为佳
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 192.168.14.1 17:18 ? 0.10s 0.00s w
root pts/1 192.168.14.1 17:18 ? 2.49s 2.45s top
root pts/2 192.168.14.1 09:19 56:17 0.03s 0.03s -bash
w输出说明
10:15:20
up 56 min,
3 users,
load average: 0.02, 0.02, 0.05
当前时间
系统运行时间
3个用于登录
1min 5min 15min,单位时间内cpu活动的进程数,不要超过cpu核数
项
说明
USER
登录的用户。
tty
用户使用的 tty 名称。
LOGIN@
用户登录的日期和时间。
IDLE
自程序上次试图读取终端开始持续的分钟数。
JCPU
该终端上的所有进程及其子进程使用的系统部件时间。
PCPU
当前活动进程所使用的系统部件时间。
What
当前进程的名称和参数。
查看几个物理cpu,每个物理cpu几核心, 总共有多少个逻辑cpu
grep -c 'physical id' /proc/cpuinfo|uniq #查看物理cpu个数
cat /proc/cpuinfo| grep "cpu cores"| uniq #查看一个物理cpu有多少核
grep -c 'processor' /proc/cpuinfo #查看逻辑cpu个数
[root@n1 ~]# grep "physical id" /proc/cpuinfo
physical id: 0
physical id: 0
physical id: 0
<