太懒
分类: LINUX
2014-05-07 12:22:30
[root@test1 ~]# more /etc/redhat-releaseRed Hat Enterprise Linux Server release 6.4 (Santiago)[root@test1 ~]#[root@test1 ~]# uname -aLinux 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 ~]# dmedmesg dmeventd dmevent_tool[root@test1 ~]# dmesg |grep schedulerio scheduler noop registeredio scheduler anticipatory registeredio scheduler deadline registeredio scheduler cfq registered (default)[root@test1 ~]#
[root@test1 ext4]# smartctl -a /dev/sdbsmartctl 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 ATADevice Model: WDC WD3200AAKS-75L9A0Serial Number: WD-WMAV2F258203LU WWN Device Id: 5 0014ee 0018fdbb9Firmware Version: 02.03E02User Capacity: 320,072,933,376 bytes [320 GB]Sector Size: 512 bytes logical/physicalDevice is: In smartctl database [for details use: -P show]ATA Version is: 8ATA Standard is: Exact ATA specification draft version not indicatedLocal Time is: Wed May 7 12:13:33 2014 CSTSMART support is: Available - device has SMART capability.SMART support is: Enabled
time sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqwr preparetime sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqwr runtime sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqwr cleanuptime sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqrewr preparetime sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqrewr runtime sysbench --num-threads=16 --file-block-size=8192 --test=fileio --file-total-size=5G --file-test-mode=seqrewr cleanup
看看当前的I/O 调度策略[root@test1 ~]# umount /ext4/[root@test1 ~]# mkfs.ext4 /dev/sdbsdb sdb1 sdb2 sdb3 sdb4 sdb5 sdb6 sdb7[root@test1 ~]# mkfs.ext4 /dev/sdb2mke2fs 1.41.12 (17-May-2010)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks3278576 inodes, 13109040 blocks655452 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=4294967296401 block groups32768 blocks per group, 32768 fragments per group8176 inodes per groupSuperblock backups stored on blocks:32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,4096000, 7962624, 11239424Writing inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 20 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.[root@test1 ~]# tune2fs -l /dev/sdb2tune2fs 1.41.12 (17-May-2010)Filesystem volume name:Last mounted on:Filesystem UUID: 2b14ee13-d2bf-4928-8bc5-49c004a79f4bFilesystem magic number: 0xEF53Filesystem 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_isizeFilesystem flags: signed_directory_hashDefault mount options: (none)Filesystem state: cleanErrors behavior: ContinueFilesystem OS type: LinuxInode count: 3278576Block count: 13109040Reserved block count: 655452Free blocks: 12857228Free inodes: 3278565First block: 0Block size: 4096Fragment size: 4096Reserved GDT blocks: 1020Blocks per group: 32768Fragments per group: 32768Inodes per group: 8176Inode blocks per group: 511Flex block group size: 16Filesystem created: Wed May 7 11:12:08 2014Last mount time: n/aLast write time: Wed May 7 11:12:20 2014Mount count: 0Maximum mount count: 20Last checked: Wed May 7 11:12:08 2014Check interval: 15552000 (6 months)Next check after: Mon Nov 3 11:12:08 2014Lifetime writes: 933 MBReserved blocks uid: 0 (user root)Reserved blocks gid: 0 (group root)First inode: 11Inode size: 256Required extra isize: 28Desired extra isize: 28Journal inode: 8Default directory hash: half_md4Directory Hash Seed: 0ff44d76-fc7d-4b92-924b-6258a13c161eJournal 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 ~]#
测试顺序[root@test1 ~]# more /sys/block/sdb/queue/schedulernoop anticipatory deadline [cfq][root@test1 ~]#
开始测试cfq noop anticipatory deadline
[root@test1 ext4]# more /sys/block/sdb/queue/schedulernoop anticipatory deadline [cfq][root@test1 ext4]# echo cfq > /sys/block/sdb/queue/scheduler[root@test1 ext4]# more /sys/block/sdb/queue/schedulernoop anticipatory deadline [cfq][root@test1 ext4]#执行测试脚本......[root@test1 ext4]#[root@test1 ext4]# more /sys/block/sdb/queue/schedulernoop 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/schedulernoop [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/schedulernoop 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