除了查看硬盘的空间使用情形外,我们还可以查看目前硬盘是否忙碌中,以了解硬盘的使用效率。我们可以使用 systat 这个指令:

# systat -vm 1
    3 users      Load    0.12    0.12    0.09                     6 26 00:38

Mem:KB      REAL              VIRTUAL                       VN PAGER    SWAP PAGER
        Tot     Share        Tot      Share      Free           in    out       in    out
Act    130120      5436     385556      11716     30540 count    146
All    233584     17544    2762124      45604           pages    846
                                                                 Interrupts
Proc:r    p    d    s    w      Csw    Trp    Sys    Int    Sof    Flt        8 cow       474 total
             75        1514    379 2525    690     66    375     70564 wire      100 0: clk
                                                    132932 act           1: atkb
14.0%Sys     1.6%Intr    2.3%User    0.0%Nice 82.2%Idl      18024 inact         3: sio1
|      |      |      |      |      |      |      |      |      |        13024 cache         4: sio0
=======+>                                             17516 free          7: ppc0
                                                           daefr     128 8: rtc
Namei           Name-cache      Dir-cache                    38 prcfr      40 9: fxp0
    Calls       hits      %       hits      %                    228 react      31 10: fxp
     1020        672     66                                      pdwak         11: hpt
                                       43 zfod               pdpgs         12: psm
Disks     ad0     da0 pass0                  43 ofod              intrn         13: npx
KB/t    28.20    0.00    0.00                     %slo-z      35664 buf       175 14: ata
tps       164       0       0                  70 tfree         334 dirty         15: ata
MB/s     4.52    0.00    0.00                               17810 desiredvnodes
% busy     43       0       0                               16852 numvnodes
                                                     13772 freevnodes
systat 有许多信息,我们使用参数 -vm1 来显示最详细的信息,并设定每 1 秒更新一次信息。在上面一堆复制的信息中,请将重点于在中间「====+>」及左下角的 Disks,中间部份的「====+>」表示目前 CPU 的使用情形,我们可以看到有 82.2% 的 Idle (闲置)。而硬盘的使用情形中,我的第一个硬盘 ad0 正在忙碌中,有 43% 的忙碌。而另一个 SCSI 硬盘 da0 则是完全闲置,也就是没有人正在使用它。

如果您想要知硬盘本身的存取速度,可以使用 diskinfo 这个指令。diskinfo 加了 -t 参数会对硬盘做一些测试并回报结果:

# diskinfo -v -t ad0
ad0
        512               # sectorsize
        40020664320       # mediasize in bytes (37G)
        78165360          # mediasize in sectors
        77545             # Cylinders according to firmware.
        16                # Heads according to firmware.
        63                # Sectors according to firmware.

Seek times:
        Full stroke:        250 iter in     5.199255 sec =     20.797 msec
        Half stroke:        250 iter in     4.011383 sec =     16.046 msec
        Quarter stroke:     500 iter in     6.797812 sec =     13.596 msec
        Short forward:      400 iter in     2.774055 sec =      6.935 msec
        Short backward:     400 iter in     3.257613 sec =      8.144 msec
        Seq outer:         2048 iter in     0.352483 sec =      0.172 msec
        Seq inner:         2048 iter in     0.369383 sec =      0.180 msec
Transfer rates:
        outside:         102400 kbytes in     4.511970 sec =      22695 kbytes/sec
        middle:          102400 kbytes in     4.770641 sec =      21465 kbytes/sec
        inside:          102400 kbytes in     4.174557 sec =      24530 kbytes/sec
diskinfo 指令的 -r 参数会先印出一些分割区的基本信息,包含 sector size、分割区大小、磁柱数量等。接下来的测试会花一点时间,测试结果包含了「Seek times」及「Transfer rates」。「Seek times」指的是硬盘的搜寻速度,而「Transfer rates」是数据找到后从硬盘传到系统的速度。


现在ArthurXF本人正在搞PHP等技术培训,如果想学习的人可以跟我联系。另外培训的招生简章在这个网址,想了解的可以去看看。加我QQ:29011218交流也可。
PHP培训招生简章
Tags:
FreeBSD | 评论(0) | 引用(0) | 阅读(5361)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]