Re: User experience issue on btrfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 2, 2020 at 10:29 PM Scott Schmit <i.grok@xxxxxxxxxxx> wrote:
>
> On Sun, Jun 28, 2020 at 03:40:11PM -0600, Chris Murphy wrote:
> > Databases and VM images are things btrfs is bad at out of the box.
> > Most of this has to do with fsync dependency of other file systems.
> > Btrfs is equipped to deal with an fsync heavy world out of the box,
> > using treelog enabled by default. But can still be slow for some
> > workloads.
>
> Does this also impact mariadb databases?  I've noticed that since
> reinstalling my machine with mediawiki installed, the performance of the
> wiki has dropped noticeably when the cache is cold (just loading the
> pages, not editing them).

Good question. A complete answer leads to a lot more questions.

Mariadb has a couple older docs on this: one suggests using 'noatime'
mount option on all file systems [1] as an optimization, and
additionally for Btrfs to use 'nodatacow' [2]. It can be set per
directory or per file using 'chattr +C' before files are created - it
won't work after the fact. 'chattr +C' will make files behave like
it's on any other filesystem: all writes are overwrites instead of
copy-on-write, no checksums, no compression.

Is this stale information? Is there something unrelated going on in
your case? Should databases setup these optimizations on behalf of
users? Does storage type make a difference? I'm just going to set
those aside for now.

To give the nodatacow suggestion a try:
## shutdown the database
# mkdir /var/lib/mysql2
# chattr +C /var/lib/mysql2
# cp /var/lib/mysql/* /var/lib/mysql2/
# rm /var/lib/mysql/
# mv /var/lib/mysql2/ /var/lib/mysql/
## resume operation

Advanced topic is what happens if you take a snapshot of a subvolume
that includes files set to nodatacow. Short answer: you can, and it's
fine. Long answer: initially this will cause datacow to resume but
still without checksums and compression, new writes are temporarily
datacow, subsequent writes are nodatacow. This behavior is the same as
if the nodatacow file had been reflink copied, either on Btrfs or XFS.


[1] https://mariadb.com/kb/en/filesystem-optimizations/
[2] https://mariadb.com/resources/blog/what-is-the-best-linux-filesystem-for-mariadb/

-- 
Chris Murphy
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux