两个节点的RH-CLUSTER,
同一个存储设备,同样的配置,写同样的文件.
比较如下:
1.GFS1
mkfs.gfs -O -j 2 -p lock_dlm -r 2048 -t cluster_name:lock_name /dev/mapper/diskgroup1p1
[root@]# time dd if=/dev/zero of=./test.img bs=4k count=10240000
10240000+0 records in
10240000+0 records out
41943040000 bytes (42 GB) copied, 254.467 seconds, 165 MB/s
real 4m14.475s
user 0m4.184s
sys 4m6.117s
截取到的vmstat信息
1 0 476 9989164 25624 14075568 0 0 0 165712 1403 373 0 15 84 0 0
1 0 476 9815724 25632 14243176 0 0 0 165796 1403 456 0 15 84 0 0
1 0 476 9646040 25632 14409468 0 0 0 165736 1409 349 0 15 84 0 0
2 0 476 9470764 25632 14579412 0 0 0 173320 1401 377 0 15 84 0 0
2 0 476 9315428 25632 14730928 0 0 0 153960 1397 366 0 15 85 0 0
1 0 476 9140812 25632 14900484 0 0 0 167632 1402 331 0 16 84 0 0
2 0 476 8960568 25640 15075376 0 0 0 176240 1410 512 0 16 84 0 0
2.GFS2
mkfs.gfs2 -O -j 2 -p lock_dlm -r 2048 -t cluster_name:lock_name /dev/mapper/diskgroup1p1
[root@sanp-gamehall-db2 msa2_vd02vol01p1]# time dd if=/dev/zero of=./test.img bs=4k count=10240000
10240000+0 records in
10240000+0 records out
41943040000 bytes (42 GB) copied, 291.332 seconds, 144 MB/s
real 4m51.352s
user 0m3.134s
sys 2m31.986s
截取到的vmstat信息
0 2 476 78072 1744 23149112 0 0 0 301648 1553 237 0 6 75 19 0
1 2 476 72932 1760 23182624 0 0 0 26672 1917 473 0 8 76 16 0
1 2 476 71076 1756 23184272 0 0 132 60 1016 628 0 13 71 16 0
1 2 476 75548 1756 23180912 0 0 0 0 1014 514 0 14 74 12 0
1 2 476 71384 1740 23183928 0 0 0 0 1010 516 0 14 74 12 0
1 2 476 73100 1740 23182964 0 0 0 0 1011 533 0 14 72 14 0
1 1 476 74756 1740 23180920 0 0 0 0 1013 521 0 14 74 12 0
1 2 476 73824 1748 23182252 0 0 0 60 1013 640 0 14 74 12 0
1 2 476 75232 1748 23180208 0 0 0 0 1014 526 0 14 74 12 0
1 0 476 76144 1748 23150872 0 0 0 276392 1432 387 0 11 81 8 0
0 2 476 73512 1748 23150872 0 0 0 401604 1742 237 0 8 84 8 0
0 2 476 75732 1748 23150872 0 0 0 272824 1486 243 0 6 75 19 0
1 1 476 75888 1756 23150864 0 0 0 291868 1543 329 0 6 75 19 0
1 1 476 76020 1756 23150872 0 0 0 265176 1483 240 0 6 75 20 0
0 2 476 75040 1756 23150872 0 0 0 294576 1522 234 0 6 75 19 0
0 1 476 95692 1768 23150872 0 0 0 207192 1470 263 0 5 78 17 0
1 1 476 74244 1792 23180544 0 0 4 30036 1839 447 0 7 80 12 0
1 2 476 71836 1800 23183388 0 0 0 60 1012 643 0 14 64 22 0
1 1 476 72388 1796 23182512 0 0 132 0 1015 523 0 13 64 22 0
1 2 476 74068 1788 23180424 0 0 0 0 1010 530 0 14 64 22 0
2 1 476 70552 1788 23181872 0 0 0 0 1100 833 0 14 64 22 0
1 1 476 72860 1788 23180588 0 0 0 0 1010 532 0 14 64 22 0
1 2 476 73648 1796 23179312 0 0 0 60 1013 648 0 14 64 22 0
0 0 476 73316 1796 23180896 0 0 16 0 1025 446 0 10 74 17 0
从上面的信息看出,GFS2的测试消耗了更多IO等待和CPU,GFS2在速度方面也有下降,并且GFS2每隔一段时间会有短暂的IO堵塞。
同时RH官方也不建议在生产系统使用GFS2文件系统。
EXT2与EXT3的比较,
配置文件如下
[defaults]
base_features = sparse_super,filetype,resize_inode,dir_index
blocksize = 4096
inode_ratio = 8192
[fs_types]
small = {
blocksize = 1024
inode_ratio = 4096
}
floppy = {
blocksize = 1024
}
news = {
inode_ratio = 4096
}
largefile = {
inode_ratio = 1048576
}
largefile4 = {
inode_ratio = 4194304
}
EXT2:
[root@]# time dd if=/dev/zero of=./test.img bs=4k count=10240000
10240000+0 records in
10240000+0 records out
41943040000 bytes (42 GB) copied, 94.7451 seconds, 443 MB/s
real 1m34.760s
user 0m1.688s
sys 0m51.302s
0 2 476 72392 27744 23739736 0 0 0 331744 1670 759 0 1 86 12 0
0 2 476 72580 27752 23740328 0 0 0 341948 1586 570 0 1 86 12 0
0 2 476 72580 27752 23740328 0 0 0 344408 1608 433 0 1 87 12 0
0 2 476 73164 27752 23740328 0 0 0 342788 1594 460 0 1 86 13 0
0 2 476 73164 27752 23740328 0 0 0 342284 1582 438 0 1 85 14 0
0 2 476 73416 27752 23740328 0 0 0 339976 1608 436 0 1 86 13 0
1 1 476 73168 27760 23740320 0 0 0 340192 1587 570 0 1 86 13 0
0 2 476 73444 27760 23740328 0 0 0 338268 1563 457 0 1 85 13 0
0 2 476 73444 27760 23740328 0 0 0 346540 1605 461 0 1 86 13 0
1 1 476 73700 27760 23740328 0 0 0 324348 1532 446 0 1 85 14 0
0 2 476 73700 27760 23740328 0 0 0 347544 1608 440 0 1 86 13 0
EXT3:
[root@sanp-gamehall-db2 msa2_vd02vol01p1]# time dd if=/dev/zero of=./test.img bs=4k count=10240000
10240000+0 records in
10240000+0 records out
41943040000 bytes (42 GB) copied, 125.324 seconds, 335 MB/s
real 2m5.354s
user 0m2.511s
sys 1m46.675s
2 9 476 73644 38676 23454500 0 0 8 319724 1597 511 0 18 36 46 0
2 9 476 74020 39004 23447696 0 0 8 331436 1609 544 0 20 36 43 0
4 9 476 70172 39304 23443504 0 0 12 323772 1580 516 0 19 37 44 0
1 10 476 72416 39600 23432712 0 0 8 312364 1586 799 0 17 36 47 0
2 9 476 77248 39936 23419664 0 0 12 288652 1522 552 0 19 36 45 0
2 0 476 133048 40188 23448368 0 0 8 209468 1513 493 0 19 48 33 0
2 9 476 76212 40520 23485780 0 0 12 358952 1522 574 0 21 36 43 0
2 9 476 77044 40852 23486328 0 0 12 340836 1619 580 0 19 25 55 0
0 11 476 70620 41224 23484304 0 0 12 291816 1564 871 0 19 26 55 0
从EXT2和EXT3的测试信息上来分析,
EXT2消耗的CPU极低在1%左右,EXT3消耗的CPU在20%左右,
EXT2消耗的IO在15%左右,EXT3消耗的IO在50%左右.
从速度上看,EXT2 为443MB/S ,EXT3为335MB/S
EXT2和EXT3按情况选择吧。安全和性能不可兼得