上一篇测试了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调度
3. deadline调度
4. cfq调度
[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