Linux下各文件系统的比较

这个问题感觉很Shit, 被问到对文件系统有什么理解, 因为自己经常会劈开Apache的日志到天, 到小时, 甚至到分钟, 所以很在乎文件的建立速度和tar包过程, 站在这个立场选文件系统的话, 要么是选XFS速度快, 要么是ReiserFS 3省空间, 呵呵, 其他的么, 就不太了解了, 又被问到日志文件系统和非日志文件系统的区别, 唉, 这种东西, 私自以为是用到的时候随机应变, 看系统的用途, 以及主要的操作来定使用什么文件系统为好, 永远不会大改变的/boot分区自然用ext2非日志系统为好, 其他就看情况而定了, 保留一篇测试报告, 作选择系统时的参考.

Benchmarking Filesystems Part II

By Justin Piszcz

Introduction

After the last article was published, I have received more than a dozen requests for a second filesystem benchmark using the 2.6 kernel. Since that time, I have converted entirely to XFS for every Linux machine I use, so I may be a bit bias regarding the XFS filesystem. I tried to keep the hardware roughly the same. Instead of a Western Digital 250GB and Promise ATA/100 controller, I am now am using a Seagate 400GB and Maxtor ATA/133 Promise controller. The physical machine remains the same, there is an additional 664MB of swap and I am now running Debian Etch. In the previous article, I was running Slackware 9.1 with custom compiled filesystem utilities. I've added a small section in the beginning that shows the filesystem creation and mount time, I've also added a graph showing these new benchmarks. After the first round of benchmarks, I received a sleuth of e-mails asking for the raw numbers. The numbers are now included in tables at the end of this e-mail for both the last and current set of benchmarks.

What's new?

1) Unify the graphs so all but one are the same type.
2) Run tests with a recent distribution and the 2.6.14.4 kernel.
3) Included the ReiserFS Version 4 benchmarks.
4) Included the raw data in matrix form at the bottom of this page.
5) Included three additional graphs:
   a) Creation time to make the actual filesystem.
   b) Time it takes to mount the filesystem.
   c) The amount of space available after formatting with the default options.

Specifications

Hardware

    COMPUTER: Dell Optiplex GX1
CPU: Pentium III 500MHZ
RAM: 768MB
SWAP: 2200MB
CONTROLLER: Maxtor Promise ATA/133 TX2 - IN PCI SLOT #1
DRIVES USED: 1] Seagate 400GB ATA/100 8MB CACHE 7200RPM
2] Maxtor 61.4GB ATA/66 2MB CACHE 5400RPM
DRIVE TESTED: The Seagate 400GB.

Software

 LIBC VERSION: 2.3.5
KERNEL: linux-2.6.14.4
COMPILER USED: gcc-4.0.3
EXT2: e2fsprogs-1.38/sbin/mkfs.EXT2
EXT3: e2fsprogs-1.38/sbin/mkfs.EXT3
JFS: jfsutils-1.1.8/sbin/mkfs.jfs
REISERFSv3: reiserfsprogs-3.6.19/sbin/mkreiserfs
REISERFSv4: reiser4progs-1.0.5/sbin/
(Used patch reiser4-for-2.6.14-1.patch w/ libaal-1.0.5 + reiser4progs-1.0.5)
XFS: xfsprogs-2.6.36/sbin/mkfs.xfs

Tests Performed

001] Create 10,000 files with touch in a directory.
002] Run 'find' on that directory.
003] Remove the directory.
004] Create 10,000 directories with mkdir in a directory.
005] Run 'find' on that directory.
006] Remove the directory containing the 10,000 directories.
007] Copy kernel tarball from other disk to test disk.
008] Copy kernel tarball from test disk to other disk.
009] Untar kernel tarball on the same disk.
010] Tar kernel tarball on the same disk.
011] Remove kernel source tree.
012] Copy kernel tarball 10 times.
013] Create 1GB file from /dev/zero.
014] Copy the 1GB file on the same disk.
015] Split a 10MB file into 1000/1024/2048/4096/8192 byte pieces.
016] Copy kernel source tree on the same disk.
017] Cat a 1GB file to /dev/null.

NOTE1: Between each test run, a 'sync' and 10 second sleep
were performed.
NOTE2: Each file system was tested on a cleanly made file
System.
NOTE3: All file systems were created using default options.
NOTE4: All tests were performed with the cron daemon killed
and with 1 user logged in.
NOTE5: All tests were run 3 times and the average was taken,
if any tests were questionable, they were re-run and
checked with the previous average for consistency.

Creating the Filesystems

EXT2
p500:~# mkfs.EXT2 /dev/hde1
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
48840704 inodes, 97677200 blocks
4883860 blocks (5.00%) reserved for the super user
First data block=0
2981 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
p500:~#
EXT3
p500:~# mkfs.EXT3 /dev/hde1
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
48840704 inodes, 97677200 blocks
4883860 blocks (5.00%) reserved for the super user
First data block=0
2981 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
p500:~#
JFS
p500:~# mkfs.jfs -q /dev/hde1
mkfs.jfs version 1.1.8, 03-May-2005
/

Format completed successfully.

390708801 kilobytes total disk space.
0.03user 1.01system 0:02.62elapsed 40%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+224minor)pagefaults 0swaps
p500:~#
REISERFS V3
p500:~# mkreiserfs -q /dev/hde1
mkreiserfs 3.6.19 (2003 www.namesys.com)

A pair of credits:
Continuing core development of ReiserFS is mostly paid for by Hans Reiser from
money made selling licenses in addition to the GPL to companies who don't want
it known that they use ReiserFS as a foundation for their proprietary product.
And my lawyer asked 'People pay you money for this?'. Yup. Life is good. If you
buy ReiserFS, you can focus on your value add rather than reinventing an entire
FS.

Chris Mason wrote the journaling code for V3, which was enormously more useful
to users than just waiting until we could create a wandering log filesystem as
Hans would have unwisely done without him.
Jeff Mahoney optimized the bitmap scanning code for V3, and performed the big
endian cleanups.
p500:~#
REISERFS V4
p500:~# mkfs.reiser4 -y /dev/hde1
p500:~#
XFS
p500:~# mkfs.xfs -f /dev/hde1
meta-data=/dev/hde1 isize=256 agcount=16, agsize=6104825 blks
= sectsz=512
data = bsize=4096 blocks=97677200, imaxpct=25
= sunit=0 swidth=0 blks, unwritten=1
naming =version 2 bsize=4096
log =internal log bsize=4096 blocks=32768, version=1
= sectsz=512 sunit=0 blks
realtime =none extsz=65536 blocks=0, rtextents=0
p500:~#

Benchmark Set 1 of 4


Both extended filesystem revisions take a backseat to their counterparts.


ReiserFS takes a VERY long time to mount the filesystem. I included this test because I found it actually takes minutes to hours mounting a ReiserFS filesystem on a large RAID volume.


People always complain about how hard drive manufacturers equate 1000 kilobytes as a megabyte, well the filesystem is also part of the problem!

Benchmark Set 2 of 4


In the first test, ReiserFSv3 continues to lead the pack, with ReiserFSv4 and JFS not far behind.


ReiserFSv4 is now the slowest filesystem to search for files, previously, it had been XFS.


XFS is no longer the slowest filesystem for removing many files. However, EXT2 and EXT3 still win by far.


Similar to the first test, EXT2 and EXT3 lag behind the other journaling filesystems.


Contrary to the first set of benchmarks I ran, it appears XFS has slightly improved, ReiserFSv4 is now the slowest with ReiserFSv3 behind it. Also in the previous test, EXT3 had suffered a huge performance hit in this area, it is now comparable to EXT2.


It appears ReiserFS v3 and v4 have some serious issues deleting large numbers of directories.


In the first benchmark test, EXT2 won the test, now XFS is the new leader.


This benchmark represents how fast the tar ball can be read from each file system. Surprisingly, XFS now exceeds EXT3.


ReiserFSv3 won the last benchmarking round; however, EXT2 and EXT3 now dominate this test.


The best journaling file system here used to be ReiserFSv3; however, JFS now wins the benchmark.


ReiserFSv3 used to be the winner, it is now ousted by EXT2 and EXT3.


The biggest difference here is most of the filesystems have evened out compared to the first benchmarking test.


This test has remained relatively the same.


Once again, mostly the same; however, it is important to note that the performance of EXT2 and EXT3 are much closer this time.


EXT2 and EXT3 take the biggest hit up to about 4096 bytes which is surprising.


EXT2 and EXT3 now outperform ReiserFSv3. In most of these benchmarks thus far, ReiserFSv4 is the slowest; however, here we see that V4 is about 12 seconds faster than V3.


JFS continues to lead this test with EXT2 and EXT3 not far behind.


The following represents the combined test times.

Benchmark Set 3 of 4


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


The following is the CPU utilization for this test.


Here is a line chart of representing all of the test times.

Benchmark Set 4 of 4


Here is a composite of the total test time for all tests.

File Benchmark II Data

Seconds Elapsed
TestTaskEXT2EXT3JFSREISERv3REISERv4XFS
001Touch 10,000 Files48.2548.2534.5933.5934.0837.47
002Find 10,000 Files0.030.030.030.030.070.04
003Remove 10,000 Files0.160.161.641.842.982.51
004Make 10,000 Directories49.7649.8734.3233.7434.6837.17
005Find 10,000 Directories0.650.650.631.071.460.72
006Remove 10,000 Directories1.661.673.5843.48119.425.39
007Copy Tarball from Other to Current Disk5.175.155.745.127.344.26
008Copy Tarball from Current to Other Disk6.967.006.976.898.216.69
009UnTAR Kernel 2.6.14.4 Tarball14.9215.1927.6426.9221.4540.81
010TAR Kernel 2.6.14.4 Source Tree14.0514.0813.0533.4925.8236.19
011Remove Kernel 2.6.14.4 Source Tree2.472.646.175.6510.159.10
012Copy 2.6.14.4 Tarball 10 Times39.4838.2939.1345.1562.1646.34
013Create a 1GB File15.0215.0215.1215.9625.4015.87
014Copy a 1GB File36.8736.5138.5447.6050.6341.25
015Split 10M File into 1000 Byte Pieces57.2657.772.994.352.954.87
016Split 10M File into 1024 Byte Pieces28.7328.972.244.042.614.01
017Split 10M File into 2048 Byte Pieces7.026.981.392.261.551.95
018Split 10M File into 4096 Byte Pieces1.851.830.671.050.990.98
019Split 10M File into 8192 Byte Pieces0.580.580.360.560.620.57
020Copy 2.6.14.4 Kernel Source Tree10.0210.0635.7631.6420.1743.42
021CAT 1GB File to /dev/null18.9018.5918.0037.3321.3718.70
CPU Utilization
TestTaskEXT2EXT3JFSREISERv3REISERv4XFS
001Touch 10,000 Files99.0099.0099.0099.0099.3399.00
002Find 10,000 Files94.0093.0094.0095.0097.0095.66
003Remove 10,000 Files98.0098.6673.6699.0099.0091.66
004Make 10,000 Directories98.0097.3399.0099.0099.6699.00
005Find 10,000 Directories99.0099.0099.0099.0099.0099.00
006Remove 10,000 Directories99.0099.0088.6699.0099.0097.00
007Copy Tarball from Other to Current Disk74.6674.6676.0074.6661.3392.33
008Copy Tarball from Current to Other Disk60.0059.3359.3362.0086.0062.66
009UnTAR Kernel 2.6.14.4 Tarball42.3341.3327.3353.0080.0026.00
010TAR Kernel 2.6.14.4 Source Tree44.0043.6651.3326.6648.6621.00
011Remove Kernel 2.6.14.4 Source Tree39.6636.6633.0089.3388.3363.66
012Copy 2.6.14.4 Tarball 10 Times79.3380.6693.3374.3373.0090.33
013Create a 1GB File56.0055.6667.3357.0050.0064.33
014Copy a 1GB File42.0042.0047.0037.3352.0049.33
015Split 10M File into 1000 Byte Pieces99.0099.0064.3396.3398.0086.33
016Split 10M File into 1024 Byte Pieces99.0099.0077.3397.6699.0097.00
017Split 10M File into 2048 Byte Pieces99.0099.0064.0096.6699.0097.33
018Split 10M File into 4096 Byte Pieces99.0099.0069.3399.0099.0097.33
019Split 10M File into 8192 Byte Pieces99.0099.0087.0089.6699.0097.66
020Copy 2.6.14.4 Kernel Source Tree65.3365.0021.3341.3370.3325.33
021CAT 1GB File to /dev/null26.3327.0027.3336.6646.3330.00

File Benchmark I Data

Conclusion

With the second round of filesystem benchmarks, I hope everyone is now satisfied with the benchmarks using the 2.6 kernel. What I gleam from these benchmarks is both EXT2 and EXT3 are now roughly the same speeds in the majority of the tests. It also appears the XFS has improved in the majority of the tests. ReiserFSv3 has slowed in many of the tests with ReiserFSv4 being the slowest in most of the tests. It is important to note that JFS has improved in some of the tests. Personally, I still choose XFS for filesystem performance and scalability.

Seconds Elapsed
TestFilesystemEXT2EXT3JFSREISERXFS
001Touch 10,000 Files34.1440.9824.5023.0327.13
002Find 10,000 Files0.020.020.020.020.04
003Remove 10,000 Files0.140.361.371.762.52
004Make 10,000 Directories73.53148.4624.1123.4229.19
005Find 10,000 Directories0.440.660.410.870.59
006Remove 10,000 Directories1.9756.314.055.376.70
007Copy Tarball from Other to Current Disk3.265.704.626.084.12
008Copy Tarball from Current to Other Disk3.363.453.493.533.45
009UnTAR Kernel 2.4.26 Tarball24.4931.7334.6412.3623.79
010TAR Kernel 2.4.26 Source Tree17.8623.4027.0622.8124.85
011Remove Kernel 2.4.26 Source Tree4.247.2610.863.184.48
012Copy 2.4.26 Tarball 10 Times18.2846.6838.1749.1626.22
013Create a 1GB File18.9322.3528.8725.8020.49
014Copy a 1GB File45.0462.4854.4671.0655.89
015Split 10M File into 1000 Byte Pieces53.3562.708.114.154.34
016Split 10M File into 1024 Byte Pieces26.2432.617.633.903.96
017Split 10M File into 2048 Byte Pieces6.407.942.832.221.95
018Split 10M File into 4096 Byte Pieces1.652.100.500.650.97
019Split 10M File into 8192 byte Pieces0.510.690.310.470.53
020Copy 2.4.26 Kernel Source Tree24.4330.6525.6822.1926.53
021CAT 1GB File to /dev/null21.7023.5220.4023.2821.13
CPU Utilization
TestFilesystemEXT2EXT3JFSREISERXFS
001Touch 10,000 Files97.6696.6692.6697.6697.00
002Find 10,000 Files98.33107.33109.6685.6680.66
003Remove 10,000 Files95.6698.3376.6697.6691.33
004Make 10,000 Directories63.0033.0096.0097.6690.66
005Find 10,000 Directories96.6697.0099.3395.3398.66
006Remove 10,000 Directories99.006.3387.6698.0089.33
007Copy Tarball from Other to Current Disk74.6679.0079.3390.3381.66
008Copy Tarball from Current to Other Disk67.0064.6664.0070.6675.66
009UnTAR Kernel 2.4.26 Tarball16.0018.6615.3378.3331.66
010TAR Kernel 2.4.26 Source Tree21.6622.6617.0032.0018.33
011Remove Kernel 2.4.26 Source Tree11.0018.339.0096.6677.33
012Copy 2.4.26 Tarball 10 Times96.6667.3366.3396.0092.00
013Create a 1GB File35.6657.6632.3384.3339.00
014Copy a 1GB File30.3341.3340.6653.3340.00
015Split 10M File into 1000 Byte Pieces97.6696.6622.3389.3392.33
016Split 10M File into 1024 Byte Pieces97.6697.3320.3389.0095.66
017Split 10M File into 2048 Byte Pieces95.3397.3326.0088.6695.66
018Split 10M File into 4096 Byte Pieces98.3398.0080.0097.3392.33
019Split 10M File into 8192 Byte Pieces99.3398.3387.0096.0094.66
020Copy 2.4.26 Kernel Source Tree19.3317.3318.0044.3325.00
021CAT 1GB File to /dev/null26.0026.0030.0030.0033.66
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值