# ============================================================ # Mavis performance tuning (2026-08-02) # Hardware: 15GB RAM, 6 vCPU, 96GB SSD # DB size: 84MB (tiny) — bottleneck is config, not capacity # ============================================================ [mysqld] # Cache hot data + indexes in RAM (was 128MB, now 4GB = 27% of RAM) innodb_buffer_pool_size = 4G # Larger redo logs = better write throughput innodb_log_file_size = 256M innodb_log_buffer_size = 32M # IO capacity for SSD (was 200, default for HDD) innodb_io_capacity = 2000 innodb_io_capacity_max = 4000 # Temp tables fit in RAM (was 16MB, now 256MB) — critical for GROUP BY max_heap_table_size = 256M tmp_table_size = 256M # Connections (was 151, more headroom for chat poller) max_connections = 200 # Slow log ON (was OFF) — find real bottlenecks slow_query_log = 1 slow_query_log_file = /var/log/mysql/mysql-slow.log long_query_time = 1 log_queries_not_using_indexes = 1 # Buffer for sorting + joins sort_buffer_size = 4M join_buffer_size = 4M read_buffer_size = 2M read_rnd_buffer_size = 4M # Table open cache table_open_cache = 2000 table_definition_cache = 1000