I want to upgrade the ram our MariaDB server (10.1.25-MariaDB-1~xenial)
to handle more connections.
I have been determining the max connections mostly based on this article which suggests to use this formula
(Available_RAM - Global_buffers) / Thread_buffers
Global_buffers it the sum of these variables.
key_buffer_size
innodb_buffer_pool_size
innodb_log_buffer_size
innodb_additional_mem_pool
net_buffer_length
Thread_buffers is the sum of these variables.
sort_buffer_size
myisam_sort_buffer_size
read_buffer_size
join_buffer_size
read_rnd_buffer_size
This appears to work and for me it gives approx. 15 connections as my theoretical max.
When I query SHOW STATUS LIKE 'max_used_connections'
, which to my understanding gives me the historical maximum connections
requested, I get 46 connections.
For background when I run SHOW VARIABLES LIKE 'max_connections'
I get 151 which I believe is the default setting value.
Is 15 connections actually my theoretical max and did the additional 31 connections failed but MySQL registered them?
Is my math wrong or more likely am I missing some variables?