Liunx下查看服务器性能
本文最后更新于 5693 天前,其中的信息可能已经有所发展或是发生改变。

uptime命令
#uptime
00:59:34 up 20 days, 14:00, 2 user, load average: 0.55, 0.57, 0.84
上面命令显示示最近1 分钟内系统的平均负载是0.55,在最近5分钟内系统的平均负载是0.57,在最近的15 分钟内系统的平均负载是0.84。一共两个用户。

cat /proc/loadavg命令
#cat /proc/loadavg
1.54 1.03 0.94 1/285 28156
返回数据的含义是:
1秒钟平均负载;5秒钟平均负载;15秒钟平均负载;总作业数;正在运行的作业总数。

cat /proc/stat命令
#cat /proc/loadavg
cpu 119560393 366 75934979 491196419 22949796 273570 1653811 0
cpu0 24181069 1 18320054 132965211 2407486 3 18623 0
cpu1 27984558 11 21594016 126044599 2248274 0 20895 0
cpu2 27843845 349 21307705 116391192 12214581 35726 98960 0
cpu3 39550920 3 14713203 115795416 6079453 237839 1515332 0
intr 2741402899 1779118189 2 0 0 2 0 3 0 1 1 0 0
ctxt 7985896352
btime 1217386758
processes 1161591
procs_running 1
procs_blocked 0
返回的数据的含义如下:

前五行是CPU时间=user+system+nice+idle+iowait+irq+softirq(具体可以查看后面提供的备注)
“intr”这行给出中断的信息,第一个为自系统启动以来,发生的所有的中断的次数;然后每个数对应一个特定的中断自系统启动以来所发生的次数。
“ctxt”给出了自系统启动以来CPU发生的上下文交换的次数。
“btime”给出了从系统启动到现在为止的时间,单位为秒。
“processes (total_forks) 自系统启动以来所创建的任务的个数目。
“procs_running”:当前运行队列的任务的数目。
“procs_blocked”:当前被阻塞的任务的数目。

备注
user+system+nice+idle+iowait+irq+softirq的含义是:
user 从系统启动开始累计到当前时刻,用户态的CPU时间(单位:jiffies) ,不包含 nice值为负进程。1 jiffies=0.01秒
nice 从系统启动开始累计到当前时刻,nice值为负的进程所占用的CPU时间(单位:jiffies)
system 从系统启动开始累计到当前时刻,核心时间(单位:jiffies)
idle 从系统启动开始累计到当前时刻,除硬盘IO等待时间以外其它等待时间(单位:jiffies)
iowait 从系统启动开始累计到当前时刻,硬盘IO等待时间(单位:jiffies)
irq 从系统启动开始累计到当前时刻,硬中断时间(单位:jiffies)
softirq 从系统启动开始累计到当前时刻,软中断时间(单位:jiffies)

评论

  1. little
    16年前
    2008-8-26 1:00:58

    收藏,顺带清除零回复。

    最近写了很多科普类型的blog啊。

  2. 16年前
    2008-8-26 14:25:33

    很好,很强大。
    但不风骚

  3. 16年前
    2008-9-16 17:20:47

    有用的都搜括走~

  4. 博主
    16年前
    2008-9-17 20:17:11

    @啤酒盖子 尽情的搜刮吧。

  5. rodericliu
    15年前
    2009-1-20 18:04:41

    /proc/loadavg

    The fourth field consists of two numbers separated by a slash (/).
    The first of these is the number of currently executing kernel scheduling entities (processes,threads); this will be less than or equal to the number of CPUs.
    The value after the slash is the number of kernel scheduling entities that currently exist on the system.

    The fifth field is the PID of the process that was most recently created on the system.

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇