Chinaunix首页 | 论坛 | 博客
  • 博客访问: 328610
  • 博文数量: 62
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 710
  • 用 户 组: 普通用户
  • 注册时间: 2013-05-14 14:12
个人简介

太懒

文章分类

全部博文(62)

文章存档

2015年(8)

2014年(20)

2013年(34)

我的朋友

分类: LINUX

2014-05-07 12:22:30

操作系统信息

[root@test1 ~]# more /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)
[root@test1 ~]#
[root@test1 ~]# uname -a
Linux test1 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@test1 ~]#
[root@test1 ~]# dme
dmesg         dmeventd      dmevent_tool
[root@test1 ~]# dmesg |grep scheduler
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
[root@test1 ~]# 


硬盘型号

[root@test1 ext4]# smartctl -a /dev/sdb
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-358.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen,

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Blue Serial ATA
Device Model:     WDC WD3200AAKS-75L9A0
Serial Number:    WD-WMAV2F258203
LU WWN Device Id: 5 0014ee 0018fdbb9
Firmware Version: 02.03E02
User Capacity:    320,072,933,376 bytes [320 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Wed May  7 12:13:33 2014 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


文件系统 EXT4

测试脚本

time sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqwr prepare
time sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqwr run
time sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqwr cleanup

time sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqrewr prepare
time sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqrewr run
time sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqrewr cleanup


准备工作

[root@test1 ~]# umount /ext4/
[root@test1 ~]# mkfs.ext4 /dev/sdb
sdb   sdb1  sdb2  sdb3  sdb4  sdb5  sdb6  sdb7
[root@test1 ~]# mkfs.ext4 /dev/sdb2
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3278576 inodes, 13109040 blocks
655452 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
401 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@test1 ~]# tune2fs -l /dev/sdb2
tune2fs 1.41.12 (17-May-2010)
Filesystem volume name:  
Last mounted on:          
Filesystem UUID:          2b14ee13-d2bf-4928-8bc5-49c004a79f4b
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              3278576
Block count:              13109040
Reserved block count:     655452
Free blocks:              12857228
Free inodes:              3278565
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1020
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8176
Inode blocks per group:   511
Flex block group size:    16
Filesystem created:       Wed May  7 11:12:08 2014
Last mount time:          n/a
Last write time:          Wed May  7 11:12:20 2014
Mount count:              0
Maximum mount count:      20
Last checked:             Wed May  7 11:12:08 2014
Check interval:           15552000 (6 months)
Next check after:         Mon Nov  3 11:12:08 2014
Lifetime writes:          933 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      0ff44d76-fc7d-4b92-924b-6258a13c161e
Journal backup:           inode blocks
[root@test1 ~]#
[root@test1 ~]# vi /etc/fstab
[root@test1 ~]#
[root@test1 ~]# mount /ext4
[root@test1 ~]# more /proc/mounts |grep sdb2
/dev/sdb2 /ext4 ext4 rw,relatime,barrier=1,data=ordered 0 0
[root@test1 ~]#

看看当前的I/O 调度策略

[root@test1 ~]# more /sys/block/sdb/queue/scheduler
noop anticipatory deadline [cfq]
[root@test1 ~]#

测试顺序

cfq noop anticipatory deadline 

开始测试

[root@test1 ext4]# more /sys/block/sdb/queue/scheduler
noop anticipatory deadline [cfq]
[root@test1 ext4]# echo cfq  > /sys/block/sdb/queue/scheduler
[root@test1 ext4]# more /sys/block/sdb/queue/scheduler
noop anticipatory deadline [cfq]
[root@test1 ext4]#

执行测试脚本......

[root@test1 ext4]#
[root@test1 ext4]# more /sys/block/sdb/queue/scheduler                          
noop anticipatory deadline [cfq]
[root@test1 ext4]# echo noop  > /sys/block/sdb/queue/scheduler                  
[root@test1 ext4]# more /sys/block/sdb/queue/scheduler
[noop] anticipatory deadline cfq
[root@test1 ext4]#

执行测试脚本......

[root@test1 ext4]# echo anticipatory  > /sys/block/sdb/queue/scheduler
[root@test1 ext4]# more /sys/block/sdb/queue/scheduler
noop [anticipatory] deadline cfq
[root@test1 ext4]#

执行测试脚本......

[root@test1 ext4]# more /sys/block/sdb/queue/scheduler                          noop [anticipatory] deadline cfq
[root@test1 ext4]# echo deadline  > /sys/block/sdb/queue/scheduler
[root@test1 ext4]# more /sys/block/sdb/queue/scheduler
noop anticipatory [deadline] cfq
[root@test1 ext4]#

执行测试脚本......


结果对比

IO Scheduler seqrw seqrerw
transferred /sec (Mb/sec) Requests/sec  transferred /sec (Mb/sec) Requests/sec 
cfq 90.146 11538.69 77.983 9981.79
noop 91.315 11688.32 80.119 10255.28
anticipatory 90.484 11581.97 80.274 10275.05
deadline 93.242 11934.95 83.188 10648.09



IO Scheduler seqrw seqrerw
transferred /sec (Mb/sec) transferred /sec (Mb/sec)
cfq 90.146 77.983
noop 91.315 80.119
anticipatory 90.484 80.274
deadline 93.242 83.188


 


IO Scheduler seqrw seqrerw
Requests/sec  Requests/sec 
cfq 11538.69 9981.79
noop 11688.32 10255.28
anticipatory 11581.97 10275.05
deadline 11934.95 10648.09

 


11934.95-11538.69=396.26/11538.69=0.03434185

#end










附件列表

     

    阅读(1040) | 评论(0) | 转发(0) |
    给主人留下些什么吧!~~