1.show the state of slow query
show variables like '%slow%';
mysqladmin -u root -p variables | grep slow; //another way
2.enable slow query log and slow query time or log path
set global slow_query_log = 'ON';
set global long_query_time = '20';
set global slow_query_log_file ='/var/log/mysql/slow-query.log';
3.關(guān)閉日志同步
sync_binlog 0
4.索引之類的緩存大小
innodb_buffer_pool_size