Edit /etc/my.cnf, /etc/mysql/my.cnf or /etc/my.cnf.d/server.cnf and add the following lines to the [mysqld] section:

expire_logs_days = 7
innodb_buffer_pool_size = 20G
innodb_log_file_size = 64M
max_connections = 11000
max_user_connections = 10000
net_write_timeout = 28800
query-cache-size = 256M
wait_timeout = 172800

Add this line to the [mysqld_safe] section:

open-files-limit = 65535