ssd noop anticipatory deadline cfq io scheduler performance test

简介:
上一篇测试了SSD分区对齐和不对齐的IOPS性能.
本文将要介绍一下SSD分区对齐的情况下, 不同的IO调度算法的iops性能.
测试结果如下
1. noop调度
[root@db-xx ~]# cat /sys/block/sde/queue/scheduler 
[noop] anticipatory deadline cfq 

[postgres@db-xx pgdata]$ pg_test_fsync
5 seconds per test
O_DIRECT supported on this platform for open_datasync and open_sync.

Compare file sync methods using one 16kB write:
(in wal_sync_method preference order, except fdatasync
is Linux's default)
        open_datasync                                 n/a
        fdatasync                       10574.965 ops/sec      95 usecs/op
        fsync                            9959.066 ops/sec     100 usecs/op
        fsync_writethrough                            n/a
        open_sync                       13894.208 ops/sec      72 usecs/op

Compare file sync methods using two 16kB writes:
(in wal_sync_method preference order, except fdatasync
is Linux's default)
        open_datasync                                 n/a
        fdatasync                        7272.895 ops/sec     137 usecs/op
        fsync                            6892.519 ops/sec     145 usecs/op
        fsync_writethrough                            n/a
        open_sync                        6968.750 ops/sec     143 usecs/op

Compare open_sync with different write sizes:
(This is designed to compare the cost of writing 16kB
in different write open_sync sizes.)
         1 * 16kB open_sync write       13905.409 ops/sec      72 usecs/op
         2 *  8kB open_sync writes       8994.942 ops/sec     111 usecs/op
         4 *  4kB open_sync writes       5241.717 ops/sec     191 usecs/op
         8 *  2kB open_sync writes       2500.587 ops/sec     400 usecs/op
        16 *  1kB open_sync writes       1300.364 ops/sec     769 usecs/op

Test if fsync on non-write file descriptor is honored:
(If the times are similar, fsync() can sync data written
on a different descriptor.)
        write, fsync, close              9292.012 ops/sec     108 usecs/op
        write, close, fsync              9201.620 ops/sec     109 usecs/op

Non-Sync'ed 16kB writes:
        write                           124100.336 ops/sec       8 usecs/op



2. anticipatory调度
[root@db-xx ~]# echo anticipatory > /sys/block/sde/queue/scheduler 
[root@db-xx ~]# cat /sys/block/sde/queue/scheduler 
noop [anticipatory] deadline cfq 

[postgres@db-xx pgdata]$ pg_test_fsync
5 seconds per test
O_DIRECT supported on this platform for open_datasync and open_sync.

Compare file sync methods using one 16kB write:
(in wal_sync_method preference order, except fdatasync
is Linux's default)
        open_datasync                                 n/a
        fdatasync                       10980.717 ops/sec      91 usecs/op
        fsync                            9989.117 ops/sec     100 usecs/op
        fsync_writethrough                            n/a
        open_sync                       13447.041 ops/sec      74 usecs/op

Compare file sync methods using two 16kB writes:
(in wal_sync_method preference order, except fdatasync
is Linux's default)
        open_datasync                                 n/a
        fdatasync                        7001.547 ops/sec     143 usecs/op
        fsync                            6757.166 ops/sec     148 usecs/op
        fsync_writethrough                            n/a
        open_sync                        6852.453 ops/sec     146 usecs/op

Compare open_sync with different write sizes:
(This is designed to compare the cost of writing 16kB
in different write open_sync sizes.)
         1 * 16kB open_sync write       13445.661 ops/sec      74 usecs/op
         2 *  8kB open_sync writes       8902.478 ops/sec     112 usecs/op
         4 *  4kB open_sync writes       5137.514 ops/sec     195 usecs/op
         8 *  2kB open_sync writes       2473.485 ops/sec     404 usecs/op
        16 *  1kB open_sync writes       1248.299 ops/sec     801 usecs/op

Test if fsync on non-write file descriptor is honored:
(If the times are similar, fsync() can sync data written
on a different descriptor.)
        write, fsync, close              8992.447 ops/sec     111 usecs/op
        write, close, fsync              8999.892 ops/sec     111 usecs/op

Non-Sync'ed 16kB writes:
        write                           131947.640 ops/sec       8 usecs/op


3. deadline调度
[root@db-xx ~]# echo deadline > /sys/block/sde/queue/scheduler 
[root@db-xx ~]# cat /sys/block/sde/queue/scheduler 
noop anticipatory [deadline] cfq 

[postgres@db-xx pgdata]$ pg_test_fsync
5 seconds per test
O_DIRECT supported on this platform for open_datasync and open_sync.

Compare file sync methods using one 16kB write:
(in wal_sync_method preference order, except fdatasync
is Linux's default)
        open_datasync                                 n/a
        fdatasync                       10475.719 ops/sec      95 usecs/op
        fsync                            9861.660 ops/sec     101 usecs/op
        fsync_writethrough                            n/a
        open_sync                       13804.860 ops/sec      72 usecs/op

Compare file sync methods using two 16kB writes:
(in wal_sync_method preference order, except fdatasync
is Linux's default)
        open_datasync                                 n/a
        fdatasync                        6998.343 ops/sec     143 usecs/op
        fsync                            6704.945 ops/sec     149 usecs/op
        fsync_writethrough                            n/a
        open_sync                        6906.296 ops/sec     145 usecs/op

Compare open_sync with different write sizes:
(This is designed to compare the cost of writing 16kB
in different write open_sync sizes.)
         1 * 16kB open_sync write       13755.100 ops/sec      73 usecs/op
         2 *  8kB open_sync writes       8987.003 ops/sec     111 usecs/op
         4 *  4kB open_sync writes       5242.396 ops/sec     191 usecs/op
         8 *  2kB open_sync writes       2491.866 ops/sec     401 usecs/op
        16 *  1kB open_sync writes       1249.717 ops/sec     800 usecs/op

Test if fsync on non-write file descriptor is honored:
(If the times are similar, fsync() can sync data written
on a different descriptor.)
        write, fsync, close              8981.361 ops/sec     111 usecs/op
        write, close, fsync              9001.074 ops/sec     111 usecs/op

Non-Sync'ed 16kB writes:
        write                           121845.410 ops/sec       8 usecs/op


4. cfq调度
[root@db-xx ~]# echo cfq > /sys/block/sde/queue/scheduler 
[root@db-xx ~]# cat /sys/block/sde/queue/scheduler 
noop anticipatory deadline [cfq] 

[postgres@db-xx pgdata]$ pg_test_fsync
5 seconds per test
O_DIRECT supported on this platform for open_datasync and open_sync.

Compare file sync methods using one 16kB write:
(in wal_sync_method preference order, except fdatasync
is Linux's default)
        open_datasync                                 n/a
        fdatasync                       10981.601 ops/sec      91 usecs/op
        fsync                            9312.220 ops/sec     107 usecs/op
        fsync_writethrough                            n/a
        open_sync                       13029.732 ops/sec      77 usecs/op

Compare file sync methods using two 16kB writes:
(in wal_sync_method preference order, except fdatasync
is Linux's default)
        open_datasync                                 n/a
        fdatasync                        6997.665 ops/sec     143 usecs/op
        fsync                            6082.214 ops/sec     164 usecs/op
        fsync_writethrough                            n/a
        open_sync                        6519.312 ops/sec     153 usecs/op

Compare open_sync with different write sizes:
(This is designed to compare the cost of writing 16kB
in different write open_sync sizes.)
         1 * 16kB open_sync write       12990.761 ops/sec      77 usecs/op
         2 *  8kB open_sync writes       8603.877 ops/sec     116 usecs/op
         4 *  4kB open_sync writes       4986.898 ops/sec     201 usecs/op
         8 *  2kB open_sync writes       2369.063 ops/sec     422 usecs/op
        16 *  1kB open_sync writes       1220.165 ops/sec     820 usecs/op

Test if fsync on non-write file descriptor is honored:
(If the times are similar, fsync() can sync data written
on a different descriptor.)
        write, fsync, close              8919.973 ops/sec     112 usecs/op
        write, close, fsync              8857.715 ops/sec     113 usecs/op

Non-Sync'ed 16kB writes:
        write                           124013.883 ops/sec       8 usecs/op

目录
相关文章
|
5月前
|
存储 Java
【IO面试题 四】、介绍一下Java的序列化与反序列化
Java的序列化与反序列化允许对象通过实现Serializable接口转换成字节序列并存储或传输,之后可以通过ObjectInputStream和ObjectOutputStream的方法将这些字节序列恢复成对象。
|
6月前
|
Java 大数据
解析Java中的NIO与传统IO的区别与应用
解析Java中的NIO与传统IO的区别与应用
|
4月前
|
Java 大数据 API
Java 流(Stream)、文件(File)和IO的区别
Java中的流(Stream)、文件(File)和输入/输出(I/O)是处理数据的关键概念。`File`类用于基本文件操作,如创建、删除和检查文件;流则提供了数据读写的抽象机制,适用于文件、内存和网络等多种数据源;I/O涵盖更广泛的输入输出操作,包括文件I/O、网络通信等,并支持异常处理和缓冲等功能。实际开发中,这三者常结合使用,以实现高效的数据处理。例如,`File`用于管理文件路径,`Stream`用于读写数据,I/O则处理复杂的输入输出需求。
268 12
|
5月前
|
Java 数据处理
Java IO 接口(Input)究竟隐藏着怎样的神秘用法?快来一探究竟,解锁高效编程新境界!
【8月更文挑战第22天】Java的输入输出(IO)操作至关重要,它支持从多种来源读取数据,如文件、网络等。常用输入流包括`FileInputStream`,适用于按字节读取文件;结合`BufferedInputStream`可提升读取效率。此外,通过`Socket`和相关输入流,还能实现网络数据读取。合理选用这些流能有效支持程序的数据处理需求。
60 2
|
5月前
|
XML 存储 JSON
【IO面试题 六】、 除了Java自带的序列化之外,你还了解哪些序列化工具?
除了Java自带的序列化,常见的序列化工具还包括JSON(如jackson、gson、fastjson)、Protobuf、Thrift和Avro,各具特点,适用于不同的应用场景和性能需求。
|
5月前
|
缓存 Java
【IO面试题 一】、介绍一下Java中的IO流
Java中的IO流是对数据输入输出操作的抽象,分为输入流和输出流,字节流和字符流,节点流和处理流,提供了多种类支持不同数据源和操作,如文件流、数组流、管道流、字符串流、缓冲流、转换流、对象流、打印流、推回输入流和数据流等。
【IO面试题 一】、介绍一下Java中的IO流
|
6月前
|
存储 缓存 Java
Java零基础入门之IO流详解(二)
Java零基础入门之IO流详解(二)