The difference between the file system XFS and EXT4

The difference between XFS and EXT4

  1. The default file system of RHEL/Centos7 is XFS, Centos6 is Ext4, and Centos5 is Ext3.
  2. XFS has strong scalability and Scalability, while Ext4 is limited by disk structure and compatibility issues.
  3. EXT4 can support the size of a single file: 16GB to 16TB
    XFS can support the size of a single file: 16TB to 16EB
  4. XFS is a 64-bit file system that theoretically supports a single file system of 8EB minus 1 byte.
    Ext4 is a 32-bit file system, which theoretically supports a single file system of 1 EB minus 1 byte.

illustrate:

Due to the historical disk structure, Ext4's inode number limit (32 digits) can only have about 4 billion files at most. Moreover, the single file size of Ext4 can only support up to 16T (4K block size), which is already a bottleneck at present. XFS uses 64-bit management space, and the file system scale can reach EB level. Actual deployment depends on the maximum block limit of the host operating system.

Performance comparison conclusion:

Under high concurrent pressure:
The performance of xfs is about 5-10% higher than that of ext4.
The io utilization of
xfs is obviously lower than that of ext4, but the cpu is relatively high. If the qps and tps are below 5000, there is no obvious difference between etf4 and xfs systems. During the pressure test, xfs experienced thread_running jitter under the condition of high concurrency of 72 concurrency, while ext4 performed relatively stable. This conclusion is based on the test data of other big players, if any

1. What is a file system

The file system is the method and data structure used by the operating system to specify files on storage devices (commonly disks, and NAND Flash-based solid-state drives) or partitions; that is, the method of organizing files on storage devices. The software organization responsible for managing and storing file information in the operating system is called a file management system, or file system for short.

2. What is Ext4

Launched in 2008, EXT4 is the fourth-generation extended file system (Fourth Extended Filesystem) of the log file system under the Linux system, and is the successor version of the ext3 file system. It's a really solid filesystem, and it's pretty much been the default option in most distros over the past few years, generated by older code. It is a journaling filesystem , meaning it keeps a record of where files are located on disk and any other changes to disk. If the system crashes, thanks to the journal technology, the file system is rarely damaged.

  • The file system capacity of Ext4 reaches 1EB, and the file capacity reaches 16TB. And EXT4 theoretically supports an unlimited number of subdirectories. In addition, EXT4's allocator MBalloc also supports one-time call to allocate multiple data blocks - - - Ext4 introduces the concept of extents, each extent is a set of continuous data blocks, and the above files can be represented by means of extents For "the file data is stored in the next 25600 data blocks", the access efficiency is improved.
  • Ext4 adds a verification function to the log data, and the log verification function can easily determine whether the log data is damaged. Moreover, Ext4 merges the two-stage log mechanism of Ext3 into one stage, which improves performance while increasing security. Logging always takes some overhead. Ext4 allows logging to be turned off, so that some users with special needs can use this to improve performance.

3. What is XSF

XFS is a high-performance log file system. It was first developed by Silicon Graphics (SGI) for their operating system in 1993. It was ported to the Linux kernel after about 2002. In 2009, RHEL Linux version 5.4 used XFS files system.

  • XFS is particularly good at handling large files while providing large data transfers. Due to its high performance, architectural scalability and robustness, XFS has always been the first choice for many enterprise systems, especially those with large amounts of data . XFS has various improvements that allow it to stand out in the file system crowd list,
  • For example, for logging of metadata operations, XFS provides logging support for file system metadata. When the filesystem is updated, metadata is written to the journal sequentially before the actual disk blocks are updated. The XFS journal is kept in a circular buffer of disk blocks and is not affected by normal file system operations. Scalable/parallel I/O, suspend/resume I/O, online defragmentation, delayed performance allocation, and more. Now, RHEL/CentOS 7 and Oracle Linux use XFS as their default file system.
  • XFS is a 64-bit file system that supports a maximum of 8 exbibytes minus 1 byte for a single file system. The actual deployment depends on the maximum block limit of the host operating system. For a 32bitLinux system, the size of files and filesystems will be limited to 16tebibytes.

Disadvantages: The XFS file system cannot be shrunk, and performance will degrade when deleting a large number of files.

Expansion: There is a lot of remaining space in xfs, but the disk space is reported to be insufficient

The xfs file system will store the inode in the first 1T space of the disk, if this part of the space is completely filled.
Solution:
When mounting, specify the inode64 option:

mount -o remount -o noatime,nodiratime,inode64,nobarrier /dev/sdb1 /backup

This has been resolved in kernel 3.7 and later versions. In fact, the default defaults mount parameter is, if there is no other need, the default is enough.

(rw,noatime,attr2,inode64,sunit=128,swidth=512,noquota)

Guess you like

Origin blog.csdn.net/m0_46400195/article/details/128050241