MySQL database insertion speed adjustment, mysql database insertion
Environment Introduction:
CentOS 1, 6.5
MySQL 5.5.40
Hardware: 4-core, 4 GB
Reference link:
Http://dev.mysql.com/doc/refman/5.5/en/insert-speed.html
Http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html
Due to the rapid expansion of business volume and increasing demand for writing speed, it is estimated that the data insertion speed should be adjusted from 2000 per minute to 100 per second, that is, 6000 per minute;
Solution:
1. Optimized Database Host IO;
2. Adjust the MySQL parameters.
Start processing:
1. Host IO Optimization
A. Set the database to an independent tablespace and place each tablespace on a different hard disk;
B. Disable other processes that affect IO on the host.
2. Adjust the my. cnf parameter to improve MySQL write speed
Innodb_autoextend_increment = 128 M
Innodb_log_buffer_size = 32 M
Innodb_log_file_size = 128 M
The preceding three parameters are gradually changed to the corresponding size.
Innodb_flush_log_at_trx_commit = 0