Skip to content

Instantly share code, notes, and snippets.

@aabumuslimov
Last active May 29, 2025 22:42
Show Gist options
  • Save aabumuslimov/b11d9faddc222dcbf1bf78a3d293f938 to your computer and use it in GitHub Desktop.
Save aabumuslimov/b11d9faddc222dcbf1bf78a3d293f938 to your computer and use it in GitHub Desktop.
MySQL expected memory allocation
SELECT ROUND((
@@GLOBAL.key_buffer_size
+ @@GLOBAL.query_cache_size
+ @@GLOBAL.tmp_table_size
+ @@GLOBAL.innodb_buffer_pool_size
+ @@GLOBAL.innodb_log_buffer_size
+ @@GLOBAL.max_connections
* (
@@GLOBAL.sort_buffer_size
+ @@GLOBAL.read_buffer_size
+ @@GLOBAL.read_rnd_buffer_size
+ @@GLOBAL.join_buffer_size
+ @@GLOBAL.thread_stack
+ @@GLOBAL.binlog_cache_size
)) / 1024 / 1024, 1) `Total MB`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment