On two database MySQL server (from two different websites), I launched a mysqltuner (we have a timeout on the web server, but we do not really know where it comes from at the moment)
Here are the optimizations to bring advise by mysqltuner, the databse runs on a machine with 4vcpu and 15 GB of ram (ubuntu 16.04 server).
mysqltuner recommendations:
db01 PROD
Variables to adjust:
query_cache_type (= 1)
join_buffer_size (> 256.0K, always use indexes with joins)
table_open_cache (> 431)
innodb_buffer_pool_size (> = 1G) if possible.
db02 PROD:
Variables to adjust:
max_connections (> 151)
wait_timeout (<28800)
interactive_timeout (<28800)
query_cache_type (= 1)
sort_buffer_size (> 256K)
read_rnd_buffer_size (> 256K)
join_buffer_size (> 256.0K, always use indexes with joins)
table_open_cache (> 431)
innodb_buffer_pool_size (> = 2G) if possible.
I want to hear your opinion and especially understand these parameters (I started working with MySQL a bit ^^).
High CPU --> find slow queries; deal with index(es) and/or formulation of queries.
High I/O --> Ditto.
High CPU or I/O and/or query timeouts --> Turn on the slowlog; that will catch it. (Better to have
long_query_time = 1.)More data than RAM --> check
innodb_buffer_pool_size"Too many connections" --> various possible causes
None of the above? --> Don't worry (yet).