3.0.1.9. Maria db settings
Posted: 26 Mar 2017 14:36
After the upgrade your mysql settings versus MariaDB could need some tweeking:
Remember some setting depends on other settings ( see the *** lines)
You can use Mysqltuner to check before and after the restart
My current server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
symbolic-links=0
skip-external-locking
skip-host-cache
skip-name-resolve
thread_cache_size = 4
query_cache_type = 0
query_cache_size = 0M
read_buffer_size = 2M
read_rnd_buffer_size = 1M
key_buffer_size = 64M
join_buffer_size = 2M
max_connections = 30 # ***
myisam_sort_buffer_size = 128M
max_heap_table_size = 32M
tmp_table_size = 32M
sort_buffer_size = 2M
tmpdir = /tmp
#
# * Galera-related settings
#
[galera]
# Mandatory settings
#wsrep_on=ON
#wsrep_provider=
#wsrep_cluster_address=
#binlog_format=row
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
bind-address = 127.0.0.1
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0
# this is only for embedded server
[embedded]
# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
# This group is only read by MariaDB-10.1 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.1]
innodb-defragment = 1
innodb_file_per_table = 1
innodb_buffer_pool_size= 512M # ***
innodb_flush_method=O_DIRECT
innodb_flush_log_at_trx_commit =2
innodb_buffer_pool_instances = 1 # *** innodb_buffer_pool_size < 1GB
Remember some setting depends on other settings ( see the *** lines)
You can use Mysqltuner to check before and after the restart
My current server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
symbolic-links=0
skip-external-locking
skip-host-cache
skip-name-resolve
thread_cache_size = 4
query_cache_type = 0
query_cache_size = 0M
read_buffer_size = 2M
read_rnd_buffer_size = 1M
key_buffer_size = 64M
join_buffer_size = 2M
max_connections = 30 # ***
myisam_sort_buffer_size = 128M
max_heap_table_size = 32M
tmp_table_size = 32M
sort_buffer_size = 2M
tmpdir = /tmp
#
# * Galera-related settings
#
[galera]
# Mandatory settings
#wsrep_on=ON
#wsrep_provider=
#wsrep_cluster_address=
#binlog_format=row
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
bind-address = 127.0.0.1
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0
# this is only for embedded server
[embedded]
# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
# This group is only read by MariaDB-10.1 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.1]
innodb-defragment = 1
innodb_file_per_table = 1
innodb_buffer_pool_size= 512M # ***
innodb_flush_method=O_DIRECT
innodb_flush_log_at_trx_commit =2
innodb_buffer_pool_instances = 1 # *** innodb_buffer_pool_size < 1GB