1、首先在一个卷组(VG)创建一个逻辑卷(LVM)
[root@Frost ~]# lvcreate -L 2560M -n lvtest vgtest 测试IO,without snap
[root@Frost fileio]# sysbench --test=fileio --num-threads=16 --file-total-size=800M --file-test-mode=rndrw prepare
sysbench 0.4.12: multi-threaded system evaluation benchmark 128 files, 6400Kb each, 800Mb total Creating files for the test...
[root@Frost fileio]# sysbench --test=fileio --num-threads=16 --file-total-size=800M --file-test-mode=rndrw run
sysbench 0.4.12: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 16 Extra file open flags: 0 128 files, 6.25Mb each 800Mb total file size Block size 16Kb Number of random requests for random IO: 10000 Read/Write ratio for combined random IO test: 1.50 Periodic FSYNC enabled, calling fsync() each 100 requests. Calling fsync() at the end of test, Enabled. Using synchronous I/O mode Doing random r/w test Threads started! WARNING: Operation time (0.000000) is less than minimal counted value, counting as 1.000000 WARNING: Percentile statistics will be inaccurate Done.
Operations performed: 6006 Read, 3994 Write, 12800 Other = 22800 Total Read 93.844Mb Written 62.406Mb Total transferred 156.25Mb (4.2037Mb/sec)
269.04 Requests/sec executed
Test execution summary:
total time: 37.1695s total number of events: 10000 total time taken by event execution: 373.4282 per-request statistics: min: 0.00ms avg: 37.34ms max: 541.79ms approx. 95 percentile: 135.88ms
Threads fairness:
events (avg/stddev): 625.0000/37.65
execution time (avg/stddev): 23.3393/0.69
2、创建第一个快照,测试IO
[root@Frost fileio]# sysbench --test=fileio --num-threads=16 --file-total-size=800M --file-test-mode=rndrw run Operations performed: 5999 Read, 4002 Write, 12802 Other = 22803 Total Read 93.734Mb Written 62.531Mb Total transferred 156.27Mb (3.2683Mb/sec)
209.17 Requests/sec executed
Test execution summary:
total time: 47.8121s total number of events: 10001 total time taken by event execution: 63.7068 per-request statistics: min: 0.00ms avg: 6.37ms max: 622.58ms approx. 95 percentile: 3.33ms
Threads fairness:
events (avg/stddev): 625.0625/92.23
execution time (avg/stddev): 3.9817/0.96
3、创建第二个快照,测试IO [root@Frost fileio]# sysbench --test=fileio --num-threads=16 --file-total-size=800M --file-test-mode=rndrw run
Operations performed: 5998 Read, 4003 Write, 12800 Other = 22801 Total Read 93.719Mb Written 62.547Mb Total transferred 156.27Mb (2.3093Mb/sec)
147.79 Requests/sec executed
Test execution summary:
total time: 67.6687s total number of events: 10001 total time taken by event execution: 97.7556 per-request statistics: min: 0.00ms avg: 9.77ms max: 1017.64ms approx. 95 percentile: 0.89ms
Threads fairness:
events (avg/stddev): 625.0625/139.65
execution time (avg/stddev): 6.1097/1.67
LVM Snap% 100% 表示快照失效 LV VG Attr LSize Origin Snap% Move Log Copy%
lvtest vgtest owi-ao 2.25G snap1 vgtest swi-a- 800.00M lvtest 15.39 snap2 vgtest swi-a- 800.00M lvtest 9.91
LVM without snap
269.04 Requests/sec executed
1个有效的snap
209.17 Requests/sec executed 77.75%
2 个有效的snap
147.79 Requests/sec executed 70.66% 54.93%
存在两个有效快照的时候,IO性能实际上下降了差不多一半。