Why XFS filesystem is recommend over EXT4

Solution Verified - Updated -

Environment

  • Red Hat AMQ Streams 1.5

Issue

  • Why is XFS filesystem recommend over EXT4?

Resolution

  • It is recommended that you configure your storage system to use the XFS file system[1][2]. AMQ Streams is also compatible with the ext4 file system, but this might require additional configuration[3] for best results.

[1] Using AMQ Streams on OpenShift > 3.1.2.1. File systems
https://access.redhat.com/documentation/en-us/red_hat_amq/7.7/html-single/using_amq_streams_on_openshift/index#file_systems

[2] Filesystem Selection
https://kafka.apache.org/documentation/#filesystems

Kafka uses regular files on disk, and as such it has no hard dependency on a specific filesystem. The two filesystems which have the most usage, however, are EXT4 and XFS. Historically, EXT4 has had more usage, but recent improvements to the XFS filesystem have shown it to have better performance characteristics for Kafka's workload with no compromise in stability.

Comparison testing was performed on a cluster with significant message loads, using a variety of filesystem creation and mount options. The primary metric in Kafka that was monitored was the "Request Local Time", indicating the amount of time append operations were taking. XFS resulted in much better local times (160ms vs. 250ms+ for the best EXT4 configuration), as well as lower average wait times. The XFS performance also showed less variability in disk performance.

[3] EXT4 Notes
https://kafka.apache.org/documentation/#ext4

EXT4 is a serviceable choice of filesystem for the Kafka data directories, however getting the most performance out of it will require adjusting several mount options. In addition, these options are generally unsafe in a failure scenario, and will result in much more data loss and corruption. For a single broker failure, this is not much of a concern as the disk can be wiped and the replicas rebuilt from the cluster. In a multiple-failure scenario, such as a power outage, this can mean underlying filesystem (and therefore data) corruption that is not easily recoverable. The following options can be adjusted:

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments