- innodb_buffer_pool_size: The buffer pool size of the InnoDB storage engine. It is generally recommended to set it to 70%-80% of the system memory.
- innodb_log_buffer_size: The log cache size of the InnoDB storage engine, it is generally recommended to set it to 16M.
- innodb_flush_log_at_trx_commit: The InnoDB storage engine writes the log to the disk when the transaction is committed. It has three values: 0, 1, and 2. Among them, 1 is the default value, which means that the log is written to the disk every time the transaction is committed. Whereas 0 means that the log is not written to disk, but is stored in the operating system cache, and 2 means that the log is written to disk once per second. It is recommended to set it to 1 to ensure data security.
- innodb_flush_method: The way the InnoDB storage engine flushes data to the disk. Its values include O_DSYNC, O_DIRECT, fsync, fsync_nosync and other methods. Among them, O_DIRECT is the default value, which means that the data is flushed to the disk by direct I/O. It is recommended to use the way.
- innodb_file_per_table: Whether to create an independent table space for each InnoDB table, it is recommended to enable this function.
- innodb_io_capacity: The disk I/O capability of the InnoDB storage engine, it is usually recommended to set it to the IOPS value of the disk.
- innodb_thread_concurrency: The thread concurrency of the InnoDB storage engine. It is recommended to set it to twice the number of CPU cores.
- max_connections: The maximum number of connections to the MySQL server, it is generally recommended to set it to 1/4-1/3 of the system memory.
- key_buffer_size: The index cache size of the MyISAM storage engine, it is recommended to set it to 1/3 of the size of all indexes.
- query_cache_size: The query cache size of the MySQL server, it is recommended to set it to 8MB-128MB.
MySQL 5.7 version parameter optimization
Guess you like
Origin blog.csdn.net/weixin_42456784/article/details/129929496
Ranking