首页 博客 娱乐 图库 新闻 体育 视频

MYSQL5.7参数优化

[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 #skip-name-resolve skip-grant-tables # To enable the InnoDB Plugin, uncomment the 2 next lines #ignore-builtin-innodb #plugin-load=innodb=ha_innodb_plugin.so # To enable InnoDB-related INFORMATION_SCHEMA tables # Join the following options to above directive ;innodb_trx=ha_innodb_plugin.so ;innodb_locks=ha_innodb_plugin.so ;innodb_cmp=ha_innodb_plugin.so ;innodb_cmp_reset=ha_innodb_plugin.so ;innodb_cmpmem=ha_innodb_plugin.so ;innodb_cmpmem_reset=ha_innodb_plugin.so skip_name_resolve = 1 max_connections = 3000 max_connect_errors = 1000 transaction_isolation = READ-COMMITTED explicit_defaults_for_timestamp = 1 join_buffer_size = 134217728 tmp_table_size = 2G max_allowed_packet = 4M sql_mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER" interactive_timeout = 1800 wait_timeout = 1800 read_buffer_size = 1G read_rnd_buffer_size = 1G sort_buffer_size = 64M ########log settings######## log_error = error.log slow_query_log = 1 slow_query_log_file = slow.log log_queries_not_using_indexes = 1 log_slow_admin_statements = 1 log_slow_slave_statements = 1 log_throttle_queries_not_using_indexes = 10 expire_logs_days = 90 long_query_time = 2 min_examined_row_limit = 100 ########replication settings######## innodb_buffer_pool_size = 6G innodb_buffer_pool_instances = 8 innodb_buffer_pool_load_at_startup = 1 innodb_buffer_pool_dump_at_shutdown = 1 innodb_lru_scan_depth = 2000 innodb_lock_wait_timeout = 5 innodb_io_capacity = 4000 innodb_io_capacity_max = 8000 innodb_flush_method = O_DIRECT innodb_file_format = Barracuda innodb_file_format_max = Barracuda innodb_log_file_size = 4G innodb_log_buffer_size = 16777216 innodb_purge_threads = 4 innodb_large_prefix = 1 innodb_thread_concurrency = 128 innodb_print_all_deadlocks = 1 innodb_strict_mode = 1 innodb_sort_buffer_size = 2G [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid query_cache_size=512M query_cache_type=1 thread_cache = 512 thread_concurrency=2 #skip-name-resolve


除非特别注明,本站所有文字均为原创文章,作者:luojie

No Comment

留言

电子邮件地址不会被公开。 必填项已用*标注

感谢你的留言。。。