linux系统性能之磁盘读写

218G 数据 ,14个进程并行拷贝,16G     ./c-routing-engine
1.9G    ./expr
14G     ./guide
24G     ./offline
3.0G    ./rank
8.9G    ./rws
2.9G    ./ra
22G     ./re00
14G     ./re01
22G     ./re1
9.3G    ./re2
14G     ./re3
26G     ./re4
29G     ./re5
17G     ./rec1

SSD :耗时15mins

普通磁盘:29mins 

 

最近有需求是从网络磁盘想本地拷贝数据,然后运行程序,完后再将数据从本地拷贝到网磁盘,由于数据可能有几十 G 至 200G 左右,所以想观察一下系统瓶颈在哪?

相关指令:

首先 、用top命令查看

top - 11:53:16 up 1 day, 19:10,  2 users,  load average: 1.20, 2.92, 3.55
Tasks: 930 total,   2 running, 927 sleeping,   1 stopped,   0 zombie
Cpu(s):  2.6%us,  0.2%sy,  0.0%ni, 97.2%id,  0.1%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  132044872k total, 125619664k used,  6425208k free,  1252580k buffers
Swap:        0k total,        0k used,        0k free, 41233480k cached

查看12.6% wa ,IO等待所占用的CPU时间的百分比,如果高过30%时IO压力高;

其次、 用iostat -x 1 10

如果 iostat 没有,要  yum install sysstat

map@~~~~~/$ iostat
Linux 2.6.32_1-18-0-0 (<>.com)         08/19/2016      _x86_64_        (40 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.14    0.06    0.69    1.30    0.00   95.82

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda              59.14      8499.04     17870.40 1321789708 2779243760
sdb               2.22         0.47      1537.57      72498  239126000
sdc               2.45         0.15      1599.44      23082  248747664
sdd               2.49         3.52      1721.23     547042  267689592
sde               0.02         0.13         1.80      20098     279287
sdf               0.02         0.13         1.80      20098     279287

 

iostat - Report Central Processing Unit (CPU) statistics and input/output statistics for devices, partitions and network filesystems (NFS).

CPU Utilization Report

The  first  report  generated  by the iostat command is the CPU Utilization Report. For multiprocessor systems, the CPU values are global averages among all processors.  The report has the following format:

%user   Show the percentage of CPU utilization that occurred while executing at the user level (application).

%nice   Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.

%system    Show the percentage of CPU utilization that occurred while executing at the system level (kernel).

%iowait      Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.

%steal       Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.

%idle         Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
 

 Device Utilization Report

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda              59.14      8499.04     17870.40 1321789708 2779243760

tps:Indicate the number of transfers per second that were issued to the device. A transfer is an I/O request to the  device.  Multiple  logical requests can be combined into a single I/O request to the device. A transfer is of indeterminate size.

Blk_read/s、Blk_wrtn/s :Indicate  the amount of data read from the device expressed in a number of blocks per second. Blocks are equivalent to sectors with kernels 2.4 and later and therefore have a size of 512 bytes. With older kernels, a block is of indeterminate size.

Blk_rea、Blk_wrtn:The total number of blocks read.

rrqm/s:The number of read requests merged per second that were queued to the device.

r/s、w/s:The number of read requests that were issued to the device per second.           

avgrq-sz:The average size (in sectors) of the requests that were issued to the device.

avgqu-sz:The average queue length of the requests that were issued to the device.

await:The average time (in milliseconds毫秒) for I/O requests issued to the device to be served. This includes the time  spent  by  the  requests  in queue and the time spent servicing them.

svctm:The average service time (in milliseconds) for I/O requests that were issued to the device. Warning! Do not trust this field any more. This field will be removed in a future sysstat version.

%util:Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100%.

Network Filesystem report

 

OPTIONS
       -c     Display the CPU utilization report.

       -d     Display the device utilization report.

       -h     Make the NFS report displayed by option -n easier to read by a human.

       -k     Display statistics in kilobytes per second instead of blocks per second.  Data displayed are valid only with kernels 2.4 and later.

       -m     Display statistics in megabytes per second instead of blocks or kilobytes per second. Data displayed are valid only with kernels 2.4 and later.

       -N     Display the registered device mapper names for any device mapper devices.  Useful for viewing LVM2 statistics.

       -n     Display the network filesystem (NFS) report. This option works only with kernel 2.6.17 and later.

       -p [ { device [,...] | ALL } ]
              The -p option displays statistics for block devices and all their partitions that are used by the system.  If a device name is entered on the command line, then statistics for it and all its partitions are displayed. Last, the ALL keyword indicates that statistics have to be  displayed  for all the block devices and partitions defined by the system, including those that have never been used.  Note that this option works only with post 2.5 kernels.

       -t     Print the time for each report displayed. The timestamp format may depend on the value of the S_TIME_FORMAT environment variable (see below).

       -V     Print version number then exit.

       -x     Display extended statistics.  This option works with post 2.5 kernels since it needs /proc/diskstats file or a mounted sysfs to  get  the  statistics.  This  option may also work with older kernels (e.g. 2.4) only if extended statistics are available in /proc/partitions (the kernel needs to be patched for that).

       -z     Tell iostat to omit output for any devices for which there was no activity during the sample period.

iostat
Display a single history since boot report for all CPU and Devices.

iostat -d 2
Display a continuous device report at two second intervals.

iostat -d 2 6
Display six reports at two second intervals for all devices.

iostat -x hda hdb 2 6
Display six reports of extended statistics at two second intervals for devices hda and hdb.

iostat -p sda 2 6
Display six reports at two second intervals for device sda and all its partitions (sda1, etc.)

 

转载于:https://my.oschina.net/u/347414/blog/735057

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值