LVMスナップショットのパフォーマンスへの影響

4415 ワード

1.まず1つのボリュームグループ(VG)に論理ボリューム(LVM)を作成する
[root@Frost~]#lvcreate-L 2560 M-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、2番目のスナップショットを作成し、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%

2つの有効なスナップショットが存在する場合、IO性能は実際には半分以下低下した.
転載先:https://blog.51cto.com/tanzj/193039