Exploring the possibilities of LXD (3.23 via snap under Debian 10.3), I faced unexpected real-slowness of MariaDB depending on the environment.
All the container below are raw install, with then mariadb-server and mariadb-client installed, and then I run this test (on a Ryzen 3700x, on SSD, with 32GB ram, kernel is 4.19 on both Debian 9 and 10):
mysqlslap --no-defaults --user=root --password --host=localhost --auto-generate-sql --verbose --concurrency=50 --iterations=10
Results below show number of seconds to run all queries.
|0.063||0.057||0.080||Host (Debian 10, mariadb 10.3.22, ext4)|
|0.039||0.032||0.085||Host (Debian 10, mariadb 10.3.22, btrfs)|
|0.053||0.036||0.109||CT 1 (Debian 9, mariadb 10.1.44, btrfs)|
|4.691||1.320||9.896||CT 1 (Debian 9, mariadb 10.3.2, btrfs)|
|0.044||0.027||0.106||CT 1 (Debian 9, mariadb 10.3.2, btrfs but /var/lib/mysql bind-mounted by LXD on ext4)|
|14.295||2.236||36.621||CT 2 (Debian 10, mariadb 10.3.22, btrfs)|
|0.043||0.029||0.121||CT 2 (Debian 10, mariadb 10.3.22, btrfs but /var/lib/mysql bind-mounted by LXD on ext4)|
- MariaDB 10.3 on host performs equally well on BRTFS and EXT4.
- MariaDB 10.3 in container under BTRFS without tuning is very very slow. I expected that copy on write would involve penalty, but not with that order of magnitude. Is that normal?
- But what’s weird was that MariaDB 10.1 in container under BTRFS is quick, as quick as with EXT4.
Any advice? Should I rather open an issue on BTRFS bugtracker or on MariaDB bugtracker (which one?)?
Your opinion is welcome!