MariaDB crashing

Hello @tcsteve,
Check dmesg and /var/log/messages for “OOM” which is your indication that the linux kernel killed mysql because it was using too much memory. This is a safety precaution that has been with linux for quite some time.

Many of your mysql config parameters are oversized. Remove all of these to restore their defaults:

key_buffer_size=512M
sort_buffer_size=48M
read_buffer_size=48M
join_buffer_size=48M
read_rnd_buffer_size=48M

Remove these as well if you are not using MyISAM tables (which you shouldn’t be):

myisam_sort_buffer_size=128M
bulk_insert_buffer_size=64M
myisam_max_sort_file_size=2G
myisam_repair_threads=2

If you had a 12GB buffer pool and only 16GB of RAM, yes, I can absolutely understand OOM happening. With 32GB of RAM, a 24GB buffer pool is a good setting.

Use this query to get a rough estimate of how much memory MySQL could possibly use:

SELECT CONCAT((@@key_buffer_size + @@query_cache_size + (@@innodb_buffer_pool_size * 1.05 + 20*1024*1024) + @@innodb_additional_mem_pool_size + @@innodb_log_buffer_size 
+ @@max_connections * (@@read_buffer_size + @@read_rnd_buffer_size + @@sort_buffer_size + @@join_buffer_size + @@binlog_cache_size + @@tmp_table_size
+ @@thread_stack)) / 1024/1024/1024, ' GB') AS "POTENTIAL MEMORY USAGE";
1 Like