Guest User

Untitled

a guest
Jan 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.96 KB | None | 0 0
  1. intel_idle.max_cstate=0 idle=poll quiet cgroup_enable=memory crashkernel=256M intel_pstate=disable
  2.  
  3. [mysql]
  4. default-character-set=utf8mb4
  5. user = root
  6. password = 123456
  7. port = 3306
  8. socket = /tmp/mysqld.sock
  9. prompt="\u@\h \d>"
  10.  
  11. [mysqld]
  12. # basic settings #
  13. user = mysql
  14. bind-address = 0.0.0.0
  15. socket = /tmp/mysqld.sock
  16. character_set_server = utf8mb4
  17. transaction_isolation = READ-COMMITTED
  18. explicit_defaults_for_timestamp = 1
  19. max_allowed_packet = 16777216
  20. event_scheduler = 1
  21. default_password_lifetime = 0
  22. autocommit = 1
  23. server-id = 1
  24. sql_mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER"
  25.  
  26. # connection #
  27. interactive_timeout = 1800
  28. wait_timeout = 1800
  29. lock_wait_timeout = 1800
  30. skip_name_resolve = 1
  31. max_connections = 512
  32. max_connect_errors = 1000000
  33.  
  34. # table cache performance settings #
  35. table_open_cache = 4096
  36. table_definition_cache = 4096
  37. table_open_cache_instances = 128 #最大64
  38.  
  39. # session memory settings #
  40. read_buffer_size = 16M
  41. read_rnd_buffer_size = 32M
  42. sort_buffer_size = 32M
  43. tmp_table_size = 64M
  44. join_buffer_size = 128M
  45. thread_cache_size = 64
  46.  
  47. # log settings #
  48. log_error = error.log
  49. log-bin = mysql-bin
  50. slow_query_log = 1
  51. slow_query_log_file = slow.log
  52. log_queries_not_using_indexes = 1
  53. log_slow_admin_statements = 1
  54. log_slow_slave_statements = 1
  55. log_throttle_queries_not_using_indexes = 10
  56. expire_logs_days = 30
  57. long_query_time = 2
  58. min_examined_row_limit = 100
  59. binlog-rows-query-log-events = 1
  60. log-bin-trust-function-creators = 1
  61. log-slave-updates = 1
  62.  
  63. # innodb settings #
  64. innodb_page_size = 16384
  65. innodb_buffer_pool_size = 160G
  66. innodb_buffer_pool_instances = 16
  67. innodb_buffer_pool_load_at_startup = 1
  68. innodb_buffer_pool_dump_at_shutdown = 1
  69. innodb_lru_scan_depth = 4096
  70. innodb_lock_wait_timeout = 5
  71. innodb_io_capacity = 10000
  72. innodb_io_capacity_max = 20000
  73. innodb_flush_method = O_DIRECT
  74. innodb_file_format = Barracuda
  75. innodb_file_format_max = Barracuda
  76. innodb_undo_logs = 128
  77. innodb_undo_tablespaces = 3
  78. innodb_flush_neighbors = 0
  79. innodb_log_file_size = 17179869184
  80. innodb_log_files_in_group = 2
  81. innodb_log_buffer_size = 16777216
  82. innodb_purge_threads = 4
  83. innodb_large_prefix = 1
  84. innodb_thread_concurrency = 64
  85. innodb_print_all_deadlocks = 1
  86. innodb_strict_mode = 1
  87. innodb_sort_buffer_size = 67108864
  88. innodb_write_io_threads = 16
  89. innodb_read_io_threads = 16
  90. innodb_file_per_table = 1
  91. innodb_stats_persistent_sample_pages = 64
  92. innodb_autoinc_lock_mode = 2
  93. innodb_online_alter_log_max_size=1G
  94. innodb_open_files=4096
  95. innodb_flush_log_at_trx_commit=1
  96.  
  97. # replication settings #
  98. master_info_repository = TABLE
  99. relay_log_info_repository = TABLE
  100. sync_binlog = 1
  101. gtid_mode = on
  102. enforce_gtid_consistency = 1
  103. log_slave_updates
  104. binlog_format = ROW
  105. binlog_rows_query_log_events = 1
  106. relay_log = relay.log
  107. relay_log_purge = 1
  108. relay_log_recovery = 1
  109. report-port = 3306
  110. report-host = 10.106.144.11
  111. slave_skip_errors = ddl_exist_errors
  112. slave-rows-search-algorithms = 'INDEX_SCAN,HASH_SCAN'
  113.  
  114. # semi sync replication settings #
  115. plugin_load = "validate_password.so;rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so"
  116. rpl_semi_sync_master_enabled = 1
  117. rpl_semi_sync_master_timeout = 3000
  118. rpl_semi_sync_slave_enabled = 1
  119.  
  120. # password plugin #
  121. validate_password_policy=STRONG
  122. validate-password=FORCE_PLUS_PERMANENT
  123.  
  124. [mysqld-5.6]
  125. # metalock performance settings
  126. metadata_locks_hash_instances=64
  127.  
  128. [mysqld-5.7]
  129. # new innodb settings #
  130. loose_innodb_numa_interleave=1
  131. innodb_buffer_pool_dump_pct = 40
  132. innodb_page_cleaners = 16
  133. innodb_undo_log_truncate = 1
  134. innodb_max_undo_log_size = 2G
  135. innodb_purge_rseg_truncate_frequency = 128
  136.  
  137. # new replication settings #
  138. slave-parallel-type = LOGICAL_CLOCK
  139. slave-parallel-workers = 16
  140. slave_preserve_commit_order=1
  141. slave_transaction_retries=128
  142.  
  143. # other change settings #
  144. binlog_gtid_simple_recovery=1
  145. log_timestamps=system
  146. show_compatibility_56=on
  147. I assume the MySQL Server as followings. You should tune the variables according to your server.
  148.  
  149. 32 CPU core
  150. 256G Memory
  151. SSD storage with 20000 IOPS in 16K page size
Add Comment
Please, Sign In to add comment