mysql tuner

Рубрики Linux
-------- Recommendations ---------------------------------------------------------------------------                               General recommendations:                                                                                                               Control warning line(s) into /var/log/mariadb/mariadb.log file                                                                     Control error line(s) into /var/log/mariadb/mariadb.log file                                                                       MySQL was started within the last 24 hours - recommendations may be inaccurate                                                     Reduce your overall MySQL memory footprint for system stability                                                                    Dedicate this server to your database for highest performance.                                                                     Enable the slow query log to troubleshoot bad queries                                                                              Reduce or eliminate unclosed connections and network issues                                                                        Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1                           When making adjustments, make tmp_table_size/max_heap_table_size equal                                                             Reduce your SELECT DISTINCT queries which have no LIMIT clause                                                                     Set thread_cache_size to 4 as a starting value                                                                                     Consider installing Sys schema from                                                             Before changing innodb_log_file_size and/or innodb_log_files_in_group read this:                        Variables to adjust:                                                                                                                 *** MySQL's maximum memory usage is dangerously high ***                                                                           *** Add RAM before increasing MySQL buffer variables ***                                                                             SET innodb_stats_on_metadata = OFF                                                                                                 query_cache_size (=0)                                                                                                              query_cache_type (=0)                                                                                                              query_cache_limit (> 1M, or use smaller result sets)                                                                               tmp_table_size (> 16M)                                                                                                             max_heap_table_size (> 16M)                                                                                                        thread_cache_size (start at 4)                                                                                                     innodb_log_file_size should be (=16M) if possible, so InnoDB total log files size equals to 25% of buffer pool size. 

Что сделать:

Размер буфера одного подключения (read_buffer_size + read_rnd_buffer_size + sort_buffer_size + thread_stack + join_buffer_size).

Так же не забываем последнее умножить на max_connections и сумма всего этого хозяйства в идиале не должна привышать вашу память.