Link to home
Start Free TrialLog in
Avatar of papakota
papakota

asked on

BTRFS for a webserver

Hello!
I've heard that btrfs is not recommended for MySQL and webserver. It's better to use ext4. Is it true? I'm talking about Ubuntu/OpenSUSE distros of Linux. Also I should add that we're talking about very few visitors (low traffic web site).
Avatar of rindi
rindi
Flag of Switzerland image

Btrfs is still regarded as beta/experimental. SUSE and OpenSUSE though are encouraging it's use though, and they have made tools which make managing it easy. On Ubuntu that isn't the case, you'd first have to get it configured properly, and then manage it regularly (create snapshots, remove old snapshots so the disks don't fill up too much).

So if you are going to use btrfs, I'd go for SUSE or OpenSUSE where it works very well and has surpassed the experimental stage in my point of view.

One reason why it doesn't get recommended for MySQL is probably the speed impact. Btrfs can slow the disk access and MySQL normally needs fast disks. If you are doing lots of writes to the disk btrfs does snapshots slowing things down. But since your load isn't expected to be high, I don't think that would be a big issue in your case, and if your visitors mainly read from the MySQL database speed wouldn't get impacted either.
Avatar of papakota
papakota

ASKER

Thanks a lot for your reply!
I only plan to use btrfs on OpenSUSE, not Ubuntu. I've read that there's a solution to MySQL issue you're mentioned. It's to created first a directory for it and then cancel COW on it. Like so:

$ sudo mkdir /var/lib/mysql
$ sudo chattr -R +C /var/lib/mysql

And then I can safely create MySQL  db there. To verify it's

$ sudo lsattr /var/lib/
---------------C /var/lib/mysql

What do you think of this solution?
I'm mostly interested in online stores and there's a minimal write input from visitors. But in my case, probably I won't notice the difference because of a low traffic.
Well, so please let me know what do you think of what I've written above.
ASKER CERTIFIED SOLUTION
Avatar of rindi
rindi
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thx!