在linux调优中经常要查看系统的负载均衡,下面列出linux下的负载均衡命令及其用法。
一. uptime
[root@localhost blue]# uptime
07:13:05 up 1 day, 1:52, 3 users, load average: 0.00, 0.02, 0.00
07:13:05 ---------> 系统当前时间
up 1 day, 1:52 --------->主机已运行时间,时间越大,说明你的机器越稳定。
3 users --------->用户总连接数而非用户总数。
load average ---------> 系统平均负载,统计最近1,5,15分钟的系统平均负载
二. w
[root@localhost blue]# w
07:18:53 up 1 day, 1:58, 3 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty1 - 20:34 10:44m 0.19s 0.19s -bash
root pts/0 192.168.132.1 00:38 1:05m 0.40s 0.40s -bash
root pts/2 192.168.132.1 00:40 0.00s 1:21 0.03s w
三. vmstat
[root@localhost blue]# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 29332 24376 11956 61672 0 0 5 8 31 47 0 0 99 0 0
四. iostat
[root@localhost blue]# iostat
Linux 2.6.32-504.el6.i686 (localhost.localdomain) 04/10/2015 _i686_(1 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.41 0.00 0.32 0.27 0.00 99.00
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 0.76 9.37 15.56 871062 1445996
五. top
[root@localhost blue]# top
top - 07:23:24 up 1 day, 2:02, 3 users, load average: 0.00, 0.00, 0.00
Tasks: 114 total, 1 running, 93 sleeping, 20 stopped, 0 zombie
Cpu(s): 0.0%us, 0.3%sy, 0.0%ni, 99.0%id, 0.0%wa, 0.3%hi, 0.3%si, 0.0%st
Mem: 1030492k total, 1006640k used, 23852k free, 12060k buffers
Swap: 2064380k total, 29328k used, 2035052k free, 61904k cached
Unknown command - try 'h' for help
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
14646 root 20 0 11712 2028 1896 S 0.3 0.2 0:08.59 sshd
1 root 20 0 2900 1208 1044 S 0.0 0.1 0:02.53 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:01.53 ksoftirqd/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 stopper/0
6 root RT 0 0 0 0 S 0.0 0.0 0:08.09 watchdog/0
7 root 20 0 0 0 0 S 0.0 0.0 0:11.62 events/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
DevOps-田飞雨 》》转载请注明源地址
喜欢 (0)or分享 (0)