From 00092d20588acfca9db1adbe866f6d39a69e5e7a Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Mon, 12 Jan 2026 16:47:12 -0500 Subject: [PATCH] MariaDB: Parameterized performance settings via .env and docker-compose command flags. --- conf/mariadb/server.cnf | 11 ++--------- docker-compose.yml | 9 +++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/conf/mariadb/server.cnf b/conf/mariadb/server.cnf index 3a2e694..f35cf4c 100644 --- a/conf/mariadb/server.cnf +++ b/conf/mariadb/server.cnf @@ -1,12 +1,11 @@ [server] [mysqld] -# Optimized for Aether Dev (based on production Linode config) +# Global defaults for Aether Dev (Overrides are in docker-compose.yml via .env) slow_query_log = ON long_query_time = 1 expire_logs_days = 90 max_binlog_size = 512M -max_connections = 500 wait_timeout = 1800 net_read_timeout = 900 net_write_timeout = 900 @@ -20,18 +19,12 @@ join_buffer_size = 16M read_buffer_size = 4M read_rnd_buffer_size = 8M sort_buffer_size = 16M -innodb_buffer_pool_size = 512M innodb_sort_buffer_size = 32M innodb_open_files = 4096 query_cache_type = ON -query_cache_size = 32M query_cache_limit = 4M -max_heap_table_size = 384M -tmp_table_size = 384M -table_open_cache = 4000 - [galera] [embedded] @@ -46,4 +39,4 @@ server_audit_events = 'CONNECT,TABLE' # skip-name-resolve helps significantly with Docker network overhead skip-name-resolve -[mariadb-10.11] +[mariadb-10.11] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 5b8cf42..494a660 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,6 +51,15 @@ services: restart: always image: mariadb:10.11 container_name: ae_mariadb_dev + command: [ + "mysqld", + "--max-connections=${MARIADB_MAX_CONNECTIONS}", + "--innodb-buffer-pool-size=${MARIADB_INNODB_BUFFER_POOL_SIZE}", + "--query-cache-size=${MARIADB_QUERY_CACHE_SIZE}", + "--tmp-table-size=${MARIADB_TMP_TABLE_SIZE}", + "--max-heap-table-size=${MARIADB_TMP_TABLE_SIZE}", + "--table-open-cache=${MARIADB_TABLE_OPEN_CACHE}" + ] environment: MYSQL_ROOT_PASSWORD: ${AE_DB_PASSWORD} MYSQL_DATABASE: ${AE_DB_NAME}