ふたつの川うるおう日記
2008-07-24 (Thu)
_ [Server][Admin] DRBD + (ext3|GFS2) ベンチマーク
DRBDとGFS2のベンチマークを取ってたら、id:shakemidさんのDRBDベンチマークってのがあったので、ついでなのでext3も同じように測ってみました。なお、接続しているスイッチはテスト対象のマシン2台と100Mbpsの上流を繋いだまま実行したので綺麗な環境での実行ではありません。
環境
- ハードウェア
下記のマシンを2台用意して試しました。
| Model | Shuttle SP35P2 PRO (Intel P35 + ICH9R) |
| CPU | Intel Core 2 Quad Q6700 2.66GHz * 1 |
| MEM | 8GB (2GB * 4) |
| HDD | Hitachi HDS721010KLA330 1TB * 2 (RAIDは組んでいない) |
| NIC | Marvell Yukon 88E8056 Gigabit Ethernet Controller (on board) |
- ソフトウェア
DRBDはCentOS PlusにあるRPMで、Bonnie++以外は全部RPMです。
| OS | CentOS 5.2 64-bit |
| Kernel | 2.6.18-92.1.6.el5 or 2.6.18-92.1.6.el5xen |
| DRBD | drbd82-8.2.6-1.el5.centos + kmod-drbd82-xen-8.2.6-1.2.6.18_92.1.6.el5 |
| GFS2 | gfs2-utils-0.1.44-1.el5_2.1, kmod-gfs2-xen-1.92-1.1.el5_2.2 |
| Bonnie++ | bonnie++-1.03c |
ネットワーク
GigabitスイッチであるPLANEX FXG-08IMVにストレートケーブルでそれぞれ接続。用意したハード2台の片方にFTPサーバを立てて、もう1台からAnonymous接続で150MBあるファイルを何回か転送したところ約112MB/secでてました。
テスト結果
以下の条件でBonnie++を使ってベンチマークを行いました。Bonnie++は、MinTimeを0.01に修正してコンパイルしてあります。結果の値は、大きなファイルを1つ読み書きするSequential Read/WriteのBlockをピックアップします。
- 使用コマンド: ./bonnie++ -d 対象ディレクトリ
条件1と2の結果から通常KernelとXen Kernelの差はほぼないっぽいので、条件3以降のKernelもすべてXen Kernelで計測しました。
| 連番 | 条件 | Sequential Read(Block) | Sequential Write(Block) |
| 1 | DRBDなし (通常Kernel + LVM + ext3) | 85773 KB/sec | 87962 KB/sec |
| 2 | DRBDなし (Xen Kernel + LVM + ext3) | 85094 KB/sec | 90184 KB/sec |
| 3 | DRBD Protocol A (LVM + ext3) | 78366 KB/sec | 29344 KB/sec |
| 4 | DRBD Protocol B (LVM + ext3) | 78337 KB/sec | 31218 KB/sec |
| 5 | DRBD Protocol C (Primary/Primary + LVM + ext3) | 84964 KB/sec | 30969 KB/sec |
| 6 | DRBD Protocol C (Primary/Secondary + LVM + ext3) | 85020 KB/sec | 32791 KB/sec |
| 7 | DRBD Protocol C (1マウント状態 + LVM + GFS2) | 84985 KB/sec | 28730 KB/sec |
| 8 | DRBD Protocol C (2マウント状態 + LVM + GFS2) | 84794 KB/sec | 27162 KB/sec |
考察
Sequential Read (Block) の性能
- 通常KernelとXen Kernelの性能差はほぼない (1%以内)
- DRBD(C)であれば、DRBD有り無しでの性能差はほぼない、DRBD(A,B)は約10%劣る
- DRBD(C) + GFS2では、GFS2領域の1台マウントと2台マウントで性能差はほぼない (1%以内)
Sequential Write (Block) の性能
- 通常KernelとXen Kernelの性能差はほぼない (3.5%良くなってる)
- DRBDなしのローカルHDDの性能を100%とすると、DRBDなし : DRBD(C) + ext3 : DRBD(C) + GFS2 = 100% : 約36.3% : 約32.3% の性能比になった
- DRBD(C) + ext3では、DRBDのPrimary/Primary(マウントは片方のみ)とPrimary/Secondaryの状態による性能差はほぼない (6%以内)
- DRBD(C) + GFS2では、GFS2領域の1台マウントと2台マウントで性能差はあまりない (6%以内)
まとめ
- DRBD + ext3でのDRBDのプロトコル間の比較は、id:shakemidさんのDRBDベンチマーク同様、C > B > Aの順に速いという結果になりました。イメージと違いますが、同じ結果なのでこういうものなのでしょう。
- ただし、その差は気にする程の大きさではないと思います
- DRBD(C) + ext3では、Read性能はDRBDなしの場合と同等なので問題にならない。Write性能は1/3程度まで劣化するが、32791 KB/sec = 262.328 Mbpsであり、十分に実用できる場面がある。
- DRBD + GFS2では、Read性能はDRBDなしの場合と同等なので問題にならない。Write性能は1/3程度まで劣化するが、ext3同様十分に実用できる場面がある。
- ただし、今回のテストでは常に片方のノードでしかRead/Writeを実施していないことを注意する必要があります。複数ノードで同時にRead/Writeすると劣化すると思われます。
生データと番外編
DRBD上でのext3とGFS2のSequential Read/Writeではそんなに差が出ませんでしたが、大量のファイルを作成したりメタデータを操作するSequential CreateとRandom Createではものすごく差がでています。どれくらい差があるかは下記の生データで確認してください。CPUはちっとも消費していないため、何かチューニングなどで改善できる箇所があるのかもしれません。
- 1. DRBDなし (通常Kernel + LVM + ext3)
Version 1.03c ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
xen01.example.o 16G 72087 89 87962 17 38257 5 83055 90 85773 5 178.8 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 95510 100 555991 98 108221 100 98191 100 854762 99 111761 100
xen01.example.org,16G,72087,89,87962,17,38257,5,83055,90,85773,5,178.8,0,16,95510,100,555991,98,108221,100,98191,100,854762,99,111761,100
- 2 DRBDなし (Xen Kernel + LVM + ext3)
Version 1.03c ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
xen01.exampl 15856M 54356 68 90184 18 37734 0 80736 90 85094 0 177.5 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 75970 102 388964 85 91870 100 76957 93 491625 120 94078 96
xen01.example.org,15856M,54356,68,90184,18,37734,0,80736,90,85094,0,177.5,0,16,75970,102,388964,85,91870,100,76957,93,491625,120,94078,96
- 3 DRBD Protocol A (LVM + ext3)
Version 1.03c ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
xen02.exampl 15856M 30375 40 29344 6 24303 2 76117 84 78366 1 147.5 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 62557 84 384590 93 91716 100 77508 100 474650 115 93507 102
xen02.example.org,15856M,30375,40,29344,6,24303,2,76117,84,78366,1,147.5,0,16,62557,84,384590,93,91716,100,77508,100,474650,115,93507,102
- 4 DRBD Protocol B (LVM + ext3)
Version 1.03c ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
xen02.exampl 15856M 33260 46 31218 6 26036 2 77506 86 78337 2 150.7 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 71903 93 383278 93 90318 99 76782 99 478631 81 93038 102
xen02.example.org,15856M,33260,46,31218,6,26036,2,77506,86,78337,2,150.7,0,16,71903,93,383278,93,90318,99,76782,99,478631,81,93038,102
- 5 DRBD Protocol C (Primary/Primary + LVM + ext3)
Version 1.03c ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
xen02.exampl 15856M 32229 44 30969 6 25675 0 79680 89 84964 0 120.4 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 74174 90 385153 94 91028 100 76385 102 479851 82 92681 101
xen02.example.org,15856M,32229,44,30969,6,25675,0,79680,89,84964,0,120.4,0,16,74174,90,385153,94,91028,100,76385,102,479851,82,92681,101
- 6 DRBD Protocol C (Primary/Secondary + LVM + ext3)
Version 1.03c ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
xen02.exampl 15856M 31714 43 32791 6 25150 0 77275 85 85020 0 143.4 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 74151 94 383222 102 91399 100 76116 102 482763 82 92257 101
xen02.example.org,15856M,31714,43,32791,6,25150,0,77275,85,85020,0,143.4,0,16,74151,94,383222,102,91399,100,76116,102,482763,82,92257,101
- 7 DRBD Protocol C (1マウント状態 + LVM + GFS2)
Version 1.03c ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
xen01.exampl 15856M 27498 37 28730 7 24922 1 69905 77 84985 0 120.5 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 122 0 181884 97 249 0 123 0 188347 91 247 0
xen01.example.org,15856M,27498,37,28730,7,24922,1,69905,77,84985,0,120.5,0,16,122,0,181884,97,249,0,123,0,188347,91,247,0
- 8 DRBD Protocol C (2マウント状態 + LVM + GFS2)
Version 1.03c ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
xen01.exampl 15856M 25856 34 27162 6 26546 1 72257 76 84794 0 122.6 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 122 0 181319 88 246 0 122 0 186669 91 249 0
xen01.example.org,15856M,25856,34,27162,6,26546,1,72257,76,84794,0,122.6,0,16,122,0,181319,88,246,0,122,0,186669,91,249,0


