Performance Comparison of ext3, ext4, XFS and btrfs file systems

Source: Internet
Author: User

Performance Comparison of ext3, ext4, XFS and btrfs file systems

Should be original: http://www.ilsistemista.net/index.php/linux-a-unix/6-linux-filesystems-benchmarked-ext3-vs-ext4-vs-xfs-vs-btrfs.html? Start = 1

There is also an introduction: http://www.phoronix.com/scan.php? Page = article & item = ext4_benchmarks & num = 2

Another: http://tetralet.luna.com.tw/index.php? OP = viewarticle & ArticleID = 214 & blogid = 1

I will only extract the core legend here.

1: single-byte write Performance Comparison

A: hard disk devices are not good at this type of test.

B: The btrfs system only has 200 k/sec, and the performance of XFS is balanced.

2: block Write Performance Comparison (because the hard disk is a block device, this comparison is more meaningful)

A: The performance is similar, but in terms of efficiency (CPU usage), the best is XFS, followed by ext4, ext3, and btrfs.

3: Direct block sequential read/write (turn off any system and File Cache)

A: If you bypass the system and File Buffer (for example, video recording, some virtual machine software, ECC), ext3/4 is the best choice, followed by btrfs, and XFS.

B: No file system can be used in all environments.

4: Random seek

A: btrfs has the worst performance, less than 20 seeks/sec

B: ext3 has the best performance. If a large number of random addressing software is used, the file system has better performance.

5. Create and delete a large number of files)

The btrfs system has the worst performance. The following is a comparison of the other three types of systems.

A: ext4 is a more efficient and high-performance system, followed by XFS and ext3.

6: sequential read/write throughput [100 writes/One fsync () without fsync, and 1 writes/One fsync ()]

A: 100 writes/One fsync () performance is similar

B: 1 writes/One fsync () ext3 has the best performance, followed by XFS, ext4, btrfs

C: Write + fsync () affects read performance in btrfs

7: random read/write Throughput

A: 100 seeks/sec each block is 16 KB. The maximum read speed is 1600 KB/sec, XFS, btrfs is greater than this value (data may not be random or the buffer may affect the result)

B: ext3 random write performance is the best, suitable for databases, high-capacity record programs and virtual machine systems

8: Write 0.1 million rows of data to PostgreSQL

A: btrfs has the best performance. ext4 and XFS have low CPU usage but poor performance.

9: read Test

A: The performance of 0.1 million read tests is not significantly different.

10: complex read/write and transaction Testing

A: ext3 has the best performance.

Therefore, it is best to use an ext3 database unless ext4 solves the so-called regression problem.

11: unpackage operation under Linux kernel 2.6.36

A: The best file system for this operation is ext4.

This operation will be affected by the cache and latency allocation. We force synchronization to see the effect.

A: XFS is slow, and ext3 is slower than ext4 and btrfs.

12: CAT operation

A: XFS is the most efficient system for this operation.

B: btrfs is the most frequently used system for execution, indicating that the system has complex metadata operations.

13: unzip the Linux core (32000 files will be generated)

A: ext3, the only system with no latency allocation capability, is the worst.

14: Create 128 files in sequence, each with a length of 16 MB (2 GB in total) fragmentation of various systems

A: btrfs system fragmentation is a serious problem (This also explains the reason for the previous low read performance of this System)

Figure after going out of the btrfs System

A: ext4, XFS, a system with a delay allocation mechanism, generates less fragments than ext3 (even if one write/One fsync ())

15: Create 128 files at random, with each 16 MB (2 GB in total) fragmentation of various systems

A: Random write will generate fragments in any system, even if there is a delay allocation.

Linux Kernel from 2.6.28
The new file system ext4 was officially supported at the beginning. Ext4 is the ultimate version of ext3. It modifies some important data structures in ext3, not just
In ext2 mode, only a log function is added. Ext4 provides better performance and reliability, as well as richer features:

1. compatible with ext3. Execute several commands to migrate from ext3 online to ext4 without reformatting the disk or reinstalling the system. The original ext3 data structure is retained, and ext4 is used for new data. Of course, the entire file system also obtains a larger capacity supported by ext4.
2. Larger file systems and larger files. Compared with the ext3 currently supports a maximum of 16 TB file systems and a maximum of 2 TB files, ext4 supports 1 EB (1,048,576 TB, 1 EB = 1024 Pb, 1 Pb = Tb) file systems, and 16 TB files.
3. unlimited number of subdirectories. Ext3 currently only supports 32,000 subdirectories, while ext4 supports an unlimited number of subdirectories.
4. extents. Ext3 collection
When using indirect block ing to operate large files, the efficiency is extremely low. For example, for a 100 MB file, 25,600 data blocks must be created in ext3 (the size of each data block ).
Is 4 kb. Ext4 introduces the extents concept popular in modern file systems.
As a group of continuous data blocks, the above files are represented as "the file data is saved in the next 25,600 data blocks", which improves a lot of efficiency.
5. Multi-block allocation. When
When writing data to the ext3 file system, the ext3 data block distributor can allocate only one 4 kb block at a time. To write a 100 MB file, you must call the 25,600
Multiple Data Block splitters, while the multi-block splitters of ext4 "multiblock Allocator" (mballoc) support allocating multiple data blocks at a time.
6. Delay allocation. The data block allocation policy of ext3 is to allocate as soon as possible, while the policy of ext4 and other modern file operating systems is to delay the allocation as much as possible, data blocks are allocated and written to the disk only after the files are written to the cache. This optimizes the data block allocation of the entire file and significantly improves the performance with the first two features.
7. Fast fsck. In the past, the first step of fsck execution was very slow, because it needs to check all inode. Now, ext4 adds a list of inode not used in each group to the inode table, in the future, The fsck ext4 file system can skip them and only check the inode in use.
8. Log verification. Logs are the most common part and can easily lead to disk hardware faults. Restoring data from damaged logs will cause more data corruption. The log verification function of ext4 can easily determine whether the log data is damaged. It also combines the two-phase Log Mechanism of ext3 into one phase, which improves the performance while increasing security.
9. "No log" (No journaling) mode. The log has some overhead. ext4 allows you to disable the log so that users with special requirements can improve the performance.
10. Online fragment. Although delayed allocation, multi-block allocation, and extents can effectively reduce File System fragments, fragments are inevitable. Ext4 supports online fragment and provides the e4defrag tool for fragment of individual files or the entire file system.
11. inode-related features. Ext4 support
With a larger inode, ext4 is 128 bytes larger than the default inode size of ext3. In order to accommodate more extended attributes (such as the nanosecond timestamp) in inode
Or inode version). The default inode size is 256 bytes. Ext4 also supports fast extended attributes (fast extended
Attributes) and inode retention (inodes reservation ).
12. Persistent preallocation ). P2P software
To ensure that the downloaded file has sufficient space for storage, an empty file with the same size as the downloaded file is often created in advance, to avoid downloading failure due to insufficient disk space in the next several hours or days.
Ext4 implements persistent pre-allocation at the file system level and provides the corresponding API (posix_fallocate () in libc), which is more than self-implemented by the application software.
Efficiency.
13. Barrier is enabled by default. Magnetic
The disk is equipped with an internal cache to re-adjust the write operation sequence of batch data and optimize the write performance. Therefore, the file system must write the log data to the disk before writing the commit record.
The commit record is written first, and the log may be damaged, which affects data integrity. In ext4, barrier is enabled by default, and only data before barrier
Only data after barriers can be written to the disk. (You can disable this feature by running the "Mount-O barrier = 0" command .)

Performance Comparison of ext3, ext4, XFS and btrfs file systems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.