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_flush_log_at_trx_commit = 0 innodb_log_file_size = 64M max_connections = 1000 max_user_connections = 990 net_write_timeout = 28800 query-cache-size = 256M table_open_cache = 1024 wait_timeout = 172800
In addition, add the following line to the [mysqld] section on larger systems (1000 concurrent calls or more) if memory allows:
innodb_buffer_pool_size = 20G
Add this line to the [mysqld_safe] section:
open-files-limit = 65535
If you are using MySQL 5.7.5 or later, add the following line to the [mysqld] section:
sql_mode = "NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"