From d1bd6bc305009dea2bac7868e0bbfee2f1fe61c7 Mon Sep 17 00:00:00 2001
From: Stefan Galinski <stefan@sgalinski.de>
Date: Tue, 21 Apr 2015 15:07:06 +0200
Subject: [PATCH] [TASK] Optimize the MySQL configuration

---
 templates/default/my.cnf.erb | 63 ++++++++++++++++++++++++++----------
 1 file changed, 46 insertions(+), 17 deletions(-)

diff --git a/templates/default/my.cnf.erb b/templates/default/my.cnf.erb
index b978d32..96670d2 100644
--- a/templates/default/my.cnf.erb
+++ b/templates/default/my.cnf.erb
@@ -1,24 +1,53 @@
 [mysqld]
-# * Fine Tuning
-key_buffer		= 16M
-max_allowed_packet	= 128M
-thread_stack		= 192K
-thread_cache_size       = 8
-# This replaces the startup script and checks MyISAM tables if needed
-# the first time they are touched
-myisam-recover         = BACKUP
-#max_connections        = 100
-#table_cache            = 64
-#thread_concurrency     = 10
-
-# * Query Cache Configuration
-query_cache_limit	= 1M
-query_cache_size        = 16M
+# disable the strict mode
+sql-mode=""
+
+key_buffer_size = 32M
+
+max_allowed_packet  = 16M
+max_connections     = 214
+thread_cache_size   = 200
+
+query_cache_limit   = 4M
+query_cache_size    = 128M
+query_cache_type    = 1
+
+tmp_table_size          = 128M
+max_heap_table_size     = 128M
+
+table_definition_cache  = 800
+join_buffer_size        = 4M
+
+table_open_cache = 200
+open_files_limit = 512
+
+#myisam-recover         = BACKUP
+myisam_sort_buffer_size = 32M
+myisam_recover_options = BACKUP
+
+innodb_buffer_pool_size   = 512M
+innodb_flush_method = O_DIRECT
+innodb_thread_concurrency = 0
+innodb_read_io_threads = 64
+innodb_write_io_threads = 64
+
+log_warnings = 2
+slave_net_timeout = 60
+
+collation_server = utf8_unicode_ci
+character_set_server = utf8
+
+long_query_time = 3
+slow_query_log = 1
+slow_query_log_file = /var/log/mysql/log-slow-queries.log
 
 [mysqldump]
 quick
 quote-names
-max_allowed_packet	= 16M
+max_allowed_packet	= 64M
 
 [isamchk]
-key_buffer		= 16M
\ No newline at end of file
+key_buffer		= 32M
+
+[mysql]
+default-character-set=utf8
-- 
GitLab