Skip to content

Instantly share code, notes, and snippets.

@cagartner
Last active January 29, 2019 12:29
Show Gist options
  • Save cagartner/4ce137db2254c405d52fbbc988e3cab7 to your computer and use it in GitHub Desktop.
Save cagartner/4ce137db2254c405d52fbbc988e3cab7 to your computer and use it in GitHub Desktop.
Magento 2 MariaDB performance configuration

We would also like to add some instructions to MariaDB usage, which are not mentioned in the official manual. Use the latest stable version of MariaDB. Properly configured MariaDB provides performance increase up to 65%. The recommended settings for innodb_buffer_pool_size on a dedicated database server are 5GB for 6GB of RAM; 12GB for 10GB of RAM, and 18GB for 24GB of RAM. If you use combined web and database servers, don’t consume more that 50% or RAM. In case of a dedicated database server, utilize ~ 80%. Other vital settings:

innodb_thread_concurrency = 2 * [numberofCPUs] + 2

innodb_flush_log_at_trx_commit = 2

thread_concurrency = [number of CPUs] * 3

thread_cache_size = 32

table_cache = 1024

query_cache_size = 64M

query_cache_limit = 2M

join_buffer_size = 8M

tmp_table_size = 256M

key_buffer = 32M

innodb_autoextend_increment=512

max_allowed_packet = 16M

max_heap_table_size = 256M

read_buffer_size = 2M

read_rnd_buffer_size = 16M

bulk_insert_buffer_size = 64M

myisam_sort_buffer_size = 128M

myisam_max_sort_file_size = 10G

myisam_max_extra_sort_file_size = 10G

myisam_repair_threads = 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment