DSM 7.1 MariaDB on Docker is much slower than MariaDB package

Currently reading
DSM 7.1 MariaDB on Docker is much slower than MariaDB package

18
5
Last edited:
There is a DS1621xs+ with NVMe SSD cache, equipped with 24 GB RAM.

There is a MariaDB10 server running on Docker.

I have an identical database running on the MariaDB10 package. (Dumped and copied from the Docker instance.)

Queries on the database of the MariaDB10 package run much faster than on the docker instance. Difference is at least 2.5x, but on some queries it is 20x.

What might be the reason of this huge perfomance difference, why are the queries slower on Docker than on the Synology Package version of MariaDB?
 
Solution
I haven't thought about it as a file system level cache. If it is, it would make sense that both benefit from it. Like you, I am not an export on this topic either. But with Synology there is a strong tendency to modify open source code to support scenarios they need.
18
5
Wondering if it is anything to do with the container's resource settings for CPU Priority and Memory Limit.
That was my first idea, too, but allocating basically all my RAM (24GB to a 200 MB database) and giving highest CPU priority didn't help.
-- post merged: --

Could also be tweaks in an option group in one of the option files.
Before you ask: I have no idea where the files are located on DSM.
I tried that, too: I found where it was located for the package and copied all the relevant data to the docker version. No help.
 
Upvote 0
Just to be sure: you mapped a host path to the container path /var/lib/mysql, right? Otherwise, the files would be written into the container's ephemeral file system, which might impact performance.
 
Upvote 0
If the containerized and native mariadb instances use the same configuration, store the same data (and same indexes!) on the same physical volume, and are both fresh started (to avoid interference from cached query results), I would expect the containerized version to be marginally slower, but not by factor 2,5,

I doubt the native mariadb instance actually benefits from the nvme cache. A containerized mariadb will most definitely not benefit from it.
 
Upvote 0
18
5
If the containerized and native mariadb instances use the same configuration, store the same data (and same indexes!) on the same physical volume, and are both fresh started (to avoid interference from cached query results), I would expect the containerized version to be marginally slower, but not by factor 2,5,

I doubt the native mariadb instance actually benefits from the nvme cache. A containerized mariadb will most definitely not benefit from it.
Yes, indexes are the same, too.
Regarding the NVMe SSD Cache: Actually Synology recommends the SSD cache to database usage, so I guess it helps at least the native package. I don't really see why the containerized mariadb would not benefit from it - the data folder is mapped to the host - , but I'm not an expert in this topic, so I might be wrong.
 
Upvote 0
I haven't thought about it as a file system level cache. If it is, it would make sense that both benefit from it. Like you, I am not an export on this topic either. But with Synology there is a strong tendency to modify open source code to support scenarios they need.
 
Upvote 0
Solution

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

I'm not sure why I get that 172.17-address or if there's a way to change that...?
Replies
20
Views
3,482
Frustrating indeed. I will read further and try to discover what is all about. Thanks for your sincere...
Replies
20
Views
5,750
I registered and want to post this for the sake of anyone who might come along looking for answers like I...
Replies
10
Views
9,266
Superb, that worked! Many thanks!
Replies
2
Views
828
  • Question
Welcome to the forum! To where? What's going on? How are CF records set as well as NPM RP record for that...
Replies
1
Views
219
  • Question
No, you have to update the stack choosing the "update the stack" button at the stack editor window. Only...
Replies
11
Views
347
I am actually not sure, if depends_on ever played any role after the first deployment at all. Usually...
Replies
1
Views
360

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Top