前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Mysql配置文件 16c64g优化

Mysql配置文件 16c64g优化

原创
作者头像
陈不成i
修改2021-06-11 14:19:34
1.2K0
修改2021-06-11 14:19:34
举报
文章被收录于专栏:ops技术分享

一.说明

以下配置适合16核64G及以上的配置,会让性能稍微提高1/3左右。

二.配置

my.cnf

  1. [client]
  2. port = 3306
  3. socket = /usr/local/mysql/mysql.sock
  4. [mysqld]
  5. #基础设置
  6. port = 3306
  7. bind-address = 0.0.0.0
  8. lower_case_table_names=1
  9. character-set-server=utf8mb4
  10. default-storage-engine=innoDB
  11. basedir=/usr/local/mysql
  12. datadir=/usr/local/mysql/data
  13. socket=/usr/local/mysql/mysql.sock
  14. log-error=/var/log/mysql/mysql.log
  15. pid-file=/usr/local/mysql/mysql.pid
  16. #扩展设置
  17. max_connections = 5000
  18. max_connect_errors = 6000
  19. connect_timeout=10
  20. wait_timeout = 300
  21. interactive_timeout = 300
  22. back_log = 300
  23. open_files_limit = 65535
  24. table_open_cache = 16000
  25. max_allowed_packet = 500M
  26. max_heap_table_size = 64M
  27. tmp_table_size = 256M
  28. read_buffer_size = 8M
  29. read_rnd_buffer_size = 8M
  30. sort_buffer_size = 8M
  31. join_buffer_size = 8M
  32. key_buffer_size = 256M
  33. thread_cache_size = 64
  34. thread_stack = 512K
  35. ft_min_word_len = 1
  36. skip-external-locking
  37. bulk_insert_buffer_size = 8M
  38. myisam_sort_buffer_size = 32M
  39. net_retry_count = 100
  40. auto_increment_increment=0
  41. auto_increment_offset=0
  42. explicit_defaults_for_timestamp=false
  43. log_bin_trust_function_creators=1
  44. performance_schema= 0
  45. transaction-isolation = REPEATABLE-READ
  46. query_cache_size = 0
  47. query_cache_type = 0
  48. #binlog日志
  49. log-bin=mysql-bin
  50. log-bin-index=mysql-bin.index
  51. server-id=1
  52. max_binlog_size = 512M
  53. binlog_format = MIXED
  54. log_slave_updates = 0
  55. expire_logs_days = 7
  56. max_relay_log_size = 512M
  57. binlog-ignore-db = mysql
  58. binlog-ignore-db = test
  59. binlog-ignore-db = information_schema
  60. binlog-ignore-db = performance_schema
  61. replicate-ignore-db = mysql
  62. replicate-ignore-db = test
  63. replicate-ignore-db = information_schema
  64. replicate-ignore-db = performance_schema
  65. binlog_cache_size = 20M
  66. max_binlog_cache_size = 15M
  67. #慢查询
  68. slow_query_log=1
  69. long_query_time=2
  70. log-queries-not-using-indexes = TRUE
  71. log_throttle_queries_not_using_indexes=1000
  72. min_examined_row_limit=1000
  73. log-slow-admin-statements = TRUE
  74. log-slow-admin-statements = TRUE
  75. #innodb引擎
  76. innodb_file_per_table = 1
  77. innodb_open_files = 1000
  78. innodb_buffer_pool_size = 48G
  79. innodb_thread_concurrency = 0
  80. innodb_purge_threads = 1
  81. innodb_flush_log_at_trx_commit = 1
  82. innodb_log_buffer_size = 128M
  83. innodb_log_file_size = 128M
  84. innodb_max_dirty_pages_pct = 85
  85. innodb_lock_wait_timeout = 120
  86. innodb_flush_method=O_DIRECT
  87. innodb_data_file_path = ibdata1:10M:autoextend
  88. innodb_autoinc_lock_mode = 2
  89. innodb_buffer_pool_dump_at_shutdown = 1
  90. innodb_buffer_pool_load_at_startup = 1
  91. innodb_support_xa =
  92. 0innodb_status_file = 1

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一.说明
  • 二.配置
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档