3

Is ext4 stable enough for databases and virtual machines? The data integrity issues were due to the data not being really written to the disk and being in the cache which would be cleared after a power loss. The work around as I understand was to put an fsync option in fstab. After enabling that option, wouldn't ext3 and ext4 result in the same performance?

In case of a power loss, which of the filesystems can prevent data loss?

2
  • The data loss issue that you're describing has to do with rename operations, delayed block allocation, and badly written code - unless you're aware of issues with the applications that you're running then don't worry. Jan 6, 2012 at 17:33
  • So if I rename a file using Debian and the power goes out immediately....the file is not renamed? How do I know which packages/applications will have issues with ext4?
    – firebird
    Jan 6, 2012 at 17:50

3 Answers 3

3

In order to prevent loss of data in case of power loss you have to use synchronous writes (sync option in fstab). This is going to kill your performance and persuade you to think of better alternatives.

ext4 is ready for production use. It is default in server oriented distributions for some time now.

In case of a power outage use a UPS. If you do not have the budget for a UPS, then your data isn't worth protecting against power outage, right?

Write caching is used in practically all contemporary filesystems: ext3, jfs2, ext4, btrfs, zfs, you name it. Database writers are very conscious about data handling and pay attention to syncing proper data at proper times.

4
  • is there a big performance improvement in going to ext4 from ext3?
    – firebird
    Jan 6, 2012 at 18:23
  • This depends on the workload. Usually it is not worse than ext3 (ext4 has barriers on by default), sometimes much better. As usual, test with your own use case is the best answer. Jan 6, 2012 at 19:37
  • If database for OLTP and high number of transactions or running multiple VMs running, which one would you chose?
    – firebird
    Jan 6, 2012 at 19:45
  • I would use ext4 unless I had a very good reason not to. The best reason would be results of a test which would show, that for my workload there is a noticeable performance delta. Do a test recovery of your backups to a test machine and run some test load on ext3 and ext4, compare and make a decision. There is no universal, always-good solution, I'm afraid. Jan 8, 2012 at 11:11
7

Yes, it's a mainstream supported FS on RHEL, Centos, SL, OEL etc.

0

You should twink twice (or more) before setting up MySQL database on ext4 partition with enabled barriers. It's better to use good old XFS. Look here : http://serenadetoacuckooo.blogspot.com/2011/04/ext4-performance-and-barrier-option.html . Ext4 has some serious latency problems due to "barrier" option. Of course barrier is turbo-safe but generally it sucks your iowait time and increases io latency few times (for mysql UPDATE it's about 10-30 times worse). However it's not a rule. Just consider my words before you do it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .