Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- /etc/my.cnf.d/server.cnf 2019-07-19 15:57:17.981964885 +0000
- +++ /root/server.cnf 2019-07-22 09:21:20.881126875 +0000
- @@ -1,12 +1,41 @@
- [server]
- [mysqld]
- -query_cache_size = 64M
- -join_buffer_size = 256K
- -tmp_table_size = 64M
- -max_heap_table_size = 64M
- -thread_cache_size = 10
- -innodb_buffer_pool_size = 32G
- -innodb_buffer_pool_instances = 10
- -max_connections=1024
- -max_allowed_packet=1024M
- -sql_mode = ""
- +
- +explicit_defaults_for_timestamp = 1 # Fix deprecation warning
- +
- +# Exclude lost+found from db list
- +ignore-db-dir=lost+found #If Mysql data stored on separate partion, we need to exclude lost+found directory,
- + # otherwise Mysql will fail to start and think lost+found is a database.
- +
- +thread_cache_size = 50 #Monitor Mysql Threads and increase if Threads_created >> Threads_cached
- +innodb_buffer_pool_size = 20G #We cannot set all system memory pool size
- +innodb_log_file_size = 256M #Good starting value
- +innodb_buffer_pool_instances = 8 # 8 is a default
- +innodb_file_per_table = 1 #Default in Mysql 5.7
- +innodb_flush_method = O_DIRECT #InnoDB has internal i/o caching we must avoid double caching β OS and Mysql
- +innodb_flush_log_at_trx_commit = 2 #Compromise value beatween speed and stability
- +query_cache_type = 0 #It is better to disable Query caching and adjust if only if needed.
- +query_cache_size = 0 #It is better to disable Query caching and adjust if only if needed.
- +key_buffer_size = 32K #Default is 128K β We do not use MyISAM
- +max_connect_errors = 1000000 #Avoid connection errors spam
- +max_connections=1024 #Not changed, to high in my opinion.
- +max_allowed_packet=1024M #Same as max_connections
- +
- +# Query logs # Query logging usefull for SQL query analyze and fix.
- +slow-query-log = 1
- +slow-query-log-file = /var/log/slow-query.log
- +long_query_time = 1
- +
- +### General recommendations ####
- +# Databases uses different SQL engines β InnoDB and MyISAM, for example, shop-tradersyard.
- +# There is no reason to do this, use one SQL engine for all databases. With Mysql 5.7 InnoDB
- +# or Barracuda will be a wise choise.
- +#
- +# Developers must study query logs and fix SQL queries, add indexes, etc if needed.
- +
- +########### Non Mysql fixes (need to investigate first) ###########
- +# Mysql running in lxc-container, thus all clients connected via TCP
- +# That means tcp parameters, like local port range and backbuffer size need to be changed
- +# to optimal values. Unfortunately, this is not easy with lxc-containers. We need to test
- +# in testing ENV first.
- +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement