Advertisement
theitd

my-itd.cnf

Jan 28th, 2019
1,386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ################################################################################
  2. #DATE: 2011-02-02
  3. #SITE: http://datastrangler.com
  4. #DESCRIPTION: MySQL config 5.0.x, 5.1.x, 5.5.x
  5. #RAM: 32GB RAM dedicated server
  6. #Connections: 2000 connections
  7. ### This my-itd.cnf file is (also) based on the following speedemy.com blog post:
  8. ### http://www.speedemy.com/17-key-mysql-config-file-settings-mysql-5-7-proof
  9. ################################################################################
  10. [mysqld_safe]
  11. nice                = -15
  12.  
  13. [client]
  14. socket              = /var/run/mysqld/mysqld.sock
  15. default-character-set       = utf8
  16. port                           = 3306
  17.  
  18. [mysqld]
  19. bind-address                = 0.0.0.0
  20. ## Charset and Collation
  21. character-set-server        = utf8
  22. collation-server            = utf8_general_ci
  23. sql_mode                    = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
  24.  
  25. ## Files
  26. back_log            = 300
  27. open-files-limit        = 10000
  28. open-files          = 1024 
  29. port                = 3306
  30. socket              = /var/run/mysqld/mysqld.sock
  31. pid-file            = /var/run/mysqld/mysqld.pid
  32. skip-external-locking
  33. skip-name-resolve
  34.  
  35. ## Logging
  36. datadir             = /var/lib/mysql
  37. relay_log           = mysql-relay-bin
  38. relay_log_index         = mysql-relay-index
  39. #log                = mysql-gen.log
  40. log_error           = /var/log/mysql/mysql-error.log
  41. log_warnings
  42. log_bin             = mysql-bin
  43. log_slow_queries        = /var/log/mysql/mysql-slow.log
  44. log-queries-not-using-indexes  = 0
  45. long_query_time         = 10    #default: 10
  46. max_binlog_size         = 256M  #max size for binlog before rolling
  47. expire_logs_days        = 4 #binlog files older than this will be purged
  48.  
  49. ## Per-Thread Buffers * (max_connections) = total per-thread mem usage
  50. thread_stack            = 256K    #default: 32bit: 192K, 64bit: 256K
  51. sort_buffer_size        = 1M      #default: 2M, larger may cause perf issues
  52. read_buffer_size        = 1M      #default: 128K, change in increments of 4K
  53. read_rnd_buffer_size        = 1M      #default: 256K               
  54. join_buffer_size        = 1M      #default: 128K
  55. binlog_cache_size       = 64K     #default: 32K, size of buffer to hold TX queries
  56. ## total per-thread buffer memory usage: 8832000K = 8.625GB
  57.  
  58. ## Query Cache
  59. query_cache_size        = 32M   #global buffer
  60. query_cache_limit       = 512K  #max query result size to put in cache
  61.  
  62. ## Connections
  63. max_connections         = 2000  #multiplier for memory usage via per-thread buffers
  64. max_connect_errors      = 100   #default: 10
  65. concurrent_insert       = 2 #default: 1, 2: enable insert for all instances
  66. connect_timeout         = 30    #default -5.1.22: 5, +5.1.22: 10
  67. max_allowed_packet      = 32M   #max size of incoming data to allow
  68.  
  69. ## Default Table Settings
  70. sql_mode            = NO_AUTO_CREATE_USER
  71.  
  72. ## Table and TMP settings
  73. max_heap_table_size         = 1G    #recommend same size as tmp_table_size
  74. bulk_insert_buffer_size     = 1G    #recommend same size as tmp_table_size
  75. tmp_table_size                  = 1G    #recommend 1G min
  76. #tmpdir                         = /data/mysql-tmp0:/data/mysql-tmp1 #Recommend using RAMDISK for tmpdir
  77.  
  78. ## Table cache settings
  79. #table_cache            = 512   #5.0.x <default: 64>
  80. #table_open_cache       = 512   #5.1.x, 5.5.x <default: 64>
  81.  
  82. ## Thread settings
  83. thread_concurrency      = 16  #recommend 2x CPU cores
  84. thread_cache_size       = 100 #recommend 5% of max_connections
  85.  
  86. ## Replication
  87. #read_only
  88. #skip-slave-start      
  89. #slave-skip-errors      = <default: none, recommend:1062>
  90. #slave-net-timeout      = <default: 3600>
  91. #slave-load-tmpdir      = <location of slave tmpdir>
  92. #slave_transaction_retries  = <default: 10>
  93. #server-id                      = <unique value>
  94. #replicate-same-server-id       = <default: 0, recommend: 0, !if log_slave_updates=1>
  95. #auto-increment-increment       = <default: none>
  96. #auto-increment-offset          = <default: none>
  97. #master-connect-retry           = <default: 60>
  98. #log-slave-updates      = <default: 0 disable>
  99. #report-host            = <master_server_ip>
  100. #report-user            = <replication_user>
  101. #report-password                = <replication_user_pass>
  102. #report-port            = <default: 3306>
  103. #replicate-do-db                =
  104. #replicate-ignore-db        =
  105. #replicate-do-table     =
  106. #relicate-ignore-table      =
  107. #replicate-rewrite-db       =
  108. #replicate-wild-do-table    =
  109. #replicate-wild-ignore-table    =
  110.  
  111. ## Replication Semi-Synchronous 5.5.x only, requires dynamic plugin loading ability
  112. #rpl_semi_sync_master_enabled   = 1 #enable = 1, disable = 0
  113. #rpl_semi_sync_master_timeout   = 1000 #in milliseconds <default: 10000>, master only setting
  114.  
  115. ## 5.1.x and 5.5.x replication related setting.
  116. #binlog_format          = MIXED
  117.  
  118. ## MyISAM Engine
  119. key_buffer          = 1M    #global buffer
  120. myisam_sort_buffer_size     = 128M  #index buffer size for creating/altering indexes
  121. myisam_max_sort_file_size   = 256M  #max file size for tmp table when creating/alering indexes
  122. myisam_repair_threads       = 4 #thread quantity when running repairs
  123. myisam_recover          = BACKUP    #repair mode, recommend BACKUP
  124.  
  125. ## InnoDB Plugin Dependent Settings
  126. #ignore-builtin-innodb
  127. #plugin-load=innodb=ha_innodb_plugin.so;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;innodb_lock_waits=ha_innodb_plugin.so
  128.  
  129. ## InnoDB IO Capacity - 5.1.x plugin, 5.5.x
  130. #innodb_io_capacity     = 200
  131.  
  132. ## InnoDB IO settings -  5.1.x only
  133. #innodb_file_io_threads     = 16
  134.  
  135. ## InnoDB IO settings -  5.5.x and greater
  136. #innodb_write_io_threads    = 16
  137. #innodb_read_io_threads     = 16
  138.  
  139. ## InnoDB Plugin Independent Settings
  140. innodb_data_home_dir            = /var/lib/mysql
  141. innodb_data_file_path       = ibdata1:128M;ibdata2:10M:autoextend
  142. innodb_log_file_size        = 512M  #64G_RAM+ = 768, 24G_RAM+ = 512, 8G_RAM+ = 256, 2G_RAM+ = 128
  143. innodb_log_files_in_group   = 4 #combined size of all logs <4GB. <2G_RAM = 2, >2G_RAM = 4
  144. innodb_buffer_pool_size     = 18G   #global buffer
  145. innodb_additional_mem_pool_size = 4M    #global buffer
  146. innodb_status_file          #extra reporting
  147. innodb_file_per_table           #enable always
  148. innodb_flush_log_at_trx_commit  = 2 #2/0 = perf, 1 = ACID
  149. innodb_table_locks      = 0 #preserve table locks
  150. innodb_log_buffer_size      = 128M  #global buffer
  151. innodb_lock_wait_timeout    = 60   
  152. innodb_thread_concurrency   = 16    #recommend 2x core quantity
  153. innodb_commit_concurrency   = 16    #recommend 4x num disks
  154. #innodb_flush_method        = O_DIRECT     #O_DIRECT = local/DAS, O_DSYNC = SAN/iSCSI
  155. innodb_support_xa       = 0        #recommend 0, disable xa to negate extra disk flush
  156. skip-innodb-doublewrite
  157.  
  158. ## Binlog sync settings
  159. ## XA transactions = 1, otherwise set to 0 for best performance
  160. sync_binlog         = 0
  161.  
  162. ## TX Isolation
  163. transaction-isolation       = REPEATABLE-READ #REPEATABLE-READ req for ACID, SERIALIZABLE req XA
  164.  
  165. ## Per-Thread Buffer memory utilization equation:
  166. #(read_buffer_size + read_rnd_buffer_size + sort_buffer_size + thread_stack + join_buffer_size + binlog_cache_size) * max_connections
  167.  
  168. ## Global Buffer memory utilization equation:
  169. # innodb_buffer_pool_size + innodb_additional_mem_pool_size + innodb_log_buffer_size + key_buffer_size + query_cache_size
  170.  
  171. [mysqldump]
  172. events
  173. quick
  174. quote-names
  175. max_allowed_packet      = 128M
  176. ignore-table=mysql.events
  177.  
  178. [client]
  179. host     = localhost
  180. user     = debian-sys-maint
  181. password = ########
  182. socket   = /var/run/mysqld/mysqld.sock
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement