I have a problem with the performance of my MariaDB server in osx arm64 (M1):
I installed MySQL server via Homebrew, after a while I reinstalled it on MariaDB 10.7.3 via Homebrew.
after that, the performance dropped a lot.
I tried deleting everything related to MySQL, reinstalling, and it didn't help.
I compare the performance native MariaDB and Docker. here are the results:
SQL:
SET profiling = 1;
DROP TABLE IF EXISTS t1;
CREATE TABLE T1 (id INT);
SHOW PROFILES;
SHOW PROFILE;
Native results:
+----------+------------+--------------------------+
| Query_ID | Duration | Query |
+----------+------------+--------------------------+
| 1 | 0.12808600 | DROP TABLE IF EXISTS t1 |
| 2 | 0.10424100 | CREATE TABLE T1 (id INT) |
+----------+------------+--------------------------+
+------------------------+----------+
| Status | Duration |
+------------------------+----------+
| Starting | 0.000085 |
| checking permissions | 0.000012 |
| Opening tables | 0.000119 |
| After opening tables | 0.000006 |
| System lock | 0.000002 |
| table lock | 0.000014 |
| creating table | 0.062390 |
| After create | 0.041476 |
| Query end | 0.000020 |
| Commit | 0.000006 |
| closing tables | 0.000007 |
| Unlocking tables | 0.000005 |
| closing tables | 0.000004 |
| Commit implicit | 0.000012 |
| Starting cleanup | 0.000006 |
| Freeing items | 0.000008 |
| Updating status | 0.000063 |
| Reset for next command | 0.000006 |
+------------------------+----------+
18 rows in set (0.001 sec)
Docker results:
+----------+------------+--------------------------+
| Query_ID | Duration | Query |
+----------+------------+--------------------------+
| 1 | 0.01055567 | DROP TABLE IF EXISTS t1 |
| 2 | 0.00028742 | CREATE TABLE T1 (id INT) |
+----------+------------+--------------------------+
+------------------------+----------+
| Status | Duration |
+------------------------+----------+
| Starting | 0.000208 |
| checking permissions | 0.000015 |
| Opening tables | 0.000027 |
| After opening tables | 0.000003 |
| closing tables | 0.000004 |
| Query end | 0.000003 |
| Rollback | 0.000002 |
| closing tables | 0.000002 |
| Commit implicit | 0.000002 |
| Starting cleanup | 0.000002 |
| Freeing items | 0.000003 |
| Updating status | 0.000015 |
| Reset for next command | 0.000003 |
+------------------------+----------+
13 rows in set (0.001 sec)
What could slow down performance in Native version? Thanks for your help.
DROP TABLE IF EXIST
and your Native is forCREATE TABLE
(notably because of 'creating table'). I tested the Docker Library container of 10.7.3 (x86_64) andDROP TABLE
showed the "System lock" and "table lock" in the profile too. My "After create" on native Linux was ~10% of the "creating table" time. There's an aspect of MAC docker being a Linux VM with shared storage which I'd expect to be slower than Native. But first, lets make sure we are measuring the same on both.