Current config:
[mysqld]
skip-name-resolve
performance_schema = OFF
max_connections = 400
query_cache_limit = 1M
query_cache_size = 100M
query_cache_type = 1
#query_cache_size = 0
#query_cache_type = 0
table_open_cache = 10240
tmp_table_size = 512M
max_heap_table_size = 512M
thread_cache_size = 128
thread_pool_size = 32
open_files_limit = 8192
wait_timeout = 30
interactive_timeout = 30
join_buffer_size = 4M
innodb_file_per_table = ON
innodb_buffer_pool_size = 4G
innodb_buffer_pool_instances = 4
innodb_log_file_size = 128M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
innodb_stats_on_metadata = OFF
innodb_lock_wait_timeout = 50