Advertisement
Guest User

Untitled

a guest
May 6th, 2021
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.45 KB | None | 0 0
  1. ; MySQL Server Instance Configuration File
  2. ; ----------------------------------------------------------------------
  3. ; Generated by the MySQL Server Instance Configuration Wizard
  4. ;
  5. ;
  6. ; Installation Instructions
  7. ; ----------------------------------------------------------------------
  8. ;
  9. ; On Linux you can copy this file to /etc/my.cnf to set global options,
  10. ; mysql-data-dir/my.cnf to set server-specific options
  11. ; (@localstatedir@ for this installation) or to
  12. ; ~/.my.cnf to set user-specific options.
  13. ;
  14. ; On Windows you should keep this file in the installation directory
  15. ; of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
  16. ; make sure the server reads the config file use the startup option
  17. ; "--defaults-file".
  18. ;
  19. ; To run the server from the command line, execute this in a
  20. ; command line shell, e.g.
  21. ; mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
  22. ;
  23. ; To install the server as a Windows service manually, execute this in a
  24. ; command line shell, e.g.
  25. ; mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
  26. ;
  27. ; And then execute this in a command line shell to start the server, e.g.
  28. ; net start MySQLXY
  29. ;
  30. ;
  31. ; Guidelines for editing this file
  32. ; ----------------------------------------------------------------------
  33. ;
  34. ; In this file, you can use all long options that the program supports.
  35. ; If you want to know the options a program supports, start the program
  36. ; with the "--help" option.
  37. ;
  38. ; More detailed information about the individual options can also be
  39. ; found in the manual.
  40. ;
  41. ; For advice on how to change settings please see
  42. ; https://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
  43. ;
  44. ;
  45. ; CLIENT SECTION
  46. ; ----------------------------------------------------------------------
  47. ;
  48. ; The following options will be read by MySQL client applications.
  49. ; Note that only client applications shipped by MySQL are guaranteed
  50. ; to read this section. If you want your own MySQL client program to
  51. ; honor these values, you need to specify it as an option during the
  52. ; MySQL client library initialization.
  53. ;
  54. [client]
  55.  
  56. ; pipe=
  57.  
  58. ; socket=MYSQL
  59.  
  60. port=3306
  61.  
  62. [mysql]
  63. no-beep
  64.  
  65. ; default-character-set=
  66.  
  67. ; SERVER SECTION
  68. ; ----------------------------------------------------------------------
  69. ;
  70. ; The following options will be read by the MySQL Server. Make sure that
  71. ; you have installed the server correctly (see above) so it reads this
  72. ; file.
  73. ;
  74. ; server_type=3
  75. [mysqld]
  76.  
  77. ; The next three options are mutually exclusive to SERVER_PORT below.
  78. ; skip-networking
  79. ; enable-named-pipe
  80. ; shared-memory
  81.  
  82. ; shared-memory-base-name=MYSQL
  83.  
  84. ; The Pipe the MySQL Server will use
  85. ; socket=MYSQL
  86.  
  87. ; The TCP/IP Port the MySQL Server will listen on
  88. port=3306
  89.  
  90. ; Path to installation directory. All paths are usually resolved relative to this.
  91. ; basedir="C:/Program Files/MySQL/MySQL Server 8.0/"
  92.  
  93. ; Path to the database root
  94. datadir=C:/ProgramData/MySQL/MySQL Server 8.0/Data
  95. tmpdir=c:/windows/temp
  96.  
  97. ; The default character set that will be used when a new schema or table is
  98. ; created and no character set is defined
  99. ; character-set-server=
  100.  
  101. ; The default authentication plugin to be used when connecting to the server
  102. default_authentication_plugin=caching_sha2_password
  103.  
  104. ; The default storage engine that will be used when create new tables when
  105. default-storage-engine=INNODB
  106.  
  107. ; Set the SQL mode to strict
  108. sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
  109.  
  110. ; General and Slow logging.
  111. log-output=FILE
  112.  
  113. general-log=0
  114.  
  115. general_log_file="LACDTL03WL8573.log"
  116.  
  117. slow-query-log=1
  118.  
  119. slow_query_log_file="LACDTL03WL8573-slow.log"
  120.  
  121. long_query_time=30
  122.  
  123. ; Error Logging.
  124. log-error="LACDTL03WL8573.err"
  125.  
  126. ; ***** Group Replication Related *****
  127. ; Specifies the base name to use for binary log files. With binary logging
  128. ; enabled, the server logs all statements that change data to the binary
  129. ; log, which is used for backup and replication.
  130. log-bin="LACDTL03WL8573-bin"
  131.  
  132. ; ***** Group Replication Related *****
  133. ; Specifies the server ID. For servers that are used in a replication topology,
  134. ; you must specify a unique server ID for each replication server, in the
  135. ; range from 1 to 2^32 − 1. “Unique” means that each ID must be different
  136. ; from every other ID in use by any other source or replica.
  137. server-id=3
  138.  
  139. ; ***** Group Replication Related *****
  140. ; The host name or IP address of the replica to be reported to the source
  141. ; during replica registration. This value appears in the output of SHOW REPLICAS
  142. ; on the source server. Leave the value unset if you do not want the replica to
  143. ; register itself with the source.
  144. ; report_host=0.0
  145.  
  146. ; NOTE: Modify this value after Server initialization won't take effect.
  147. lower_case_table_names=1
  148.  
  149. ; Secure File Priv.
  150. secure-file-priv=""
  151.  
  152. ; The maximum amount of concurrent sessions the MySQL server will
  153. ; allow. One of these connections will be reserved for a user with
  154. ; SUPER privileges to allow the administrator to login even if the
  155. ; connection limit has been reached.
  156. max_connections=151
  157.  
  158. ; The number of open tables for all threads. Increasing this value
  159. ; increases the number of file descriptors that mysqld requires.
  160. ; Therefore you have to make sure to set the amount of open files
  161. ; allowed to at least 4096 in the variable "open-files-limit" in
  162. ; section [mysqld_safe]
  163. table_open_cache=2000
  164.  
  165. ; Maximum size for internal (in-memory) temporary tables. If a table
  166. ; grows larger than this value, it is automatically converted to disk
  167. ; based table This limitation is for a single table. There can be many
  168. ; of them.
  169. ;tmp_table_size=49M
  170. tmp_table_size=256M
  171.  
  172. ; How many threads we should keep in a cache for reuse. When a client
  173. ; disconnects, the client's threads are put in the cache if there aren't
  174. ; more than thread_cache_size threads from before. This greatly reduces
  175. ; the amount of thread creations needed if you have a lot of new
  176. ; connections. (Normally this doesn't give a notable performance
  177. ; improvement if you have a good thread implementation.)
  178. thread_cache_size=30
  179.  
  180. ;*** MyISAM Specific options
  181. ; The maximum size of the temporary file MySQL is allowed to use while
  182. ; recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
  183. ; If the file-size would be bigger than this, the index will be created
  184. ; through the key cache (which is slower).
  185. myisam_max_sort_file_size=100G
  186.  
  187. ; The size of the buffer that is allocated when sorting MyISAM indexes
  188. ; during a REPAIR TABLE or when creating indexes with CREATE INDEX
  189. ; or ALTER TABLE.
  190. myisam_sort_buffer_size=89M
  191.  
  192. ; Size of the Key Buffer, used to cache index blocks for MyISAM tables.
  193. ; Do not set it larger than 30% of your available memory, as some memory
  194. ; is also required by the OS to cache rows. Even if you're not using
  195. ; MyISAM tables, you should still set it to 8-64M as it will also be
  196. ; used for internal temporary disk tables.
  197. key_buffer_size=8M
  198.  
  199. ; Size of the buffer used for doing full table scans of MyISAM tables.
  200. ; Allocated per thread, if a full scan is needed.
  201. read_buffer_size=64K
  202.  
  203. read_rnd_buffer_size=256K
  204.  
  205. ;*** INNODB Specific options ***
  206. ; innodb_data_home_dir=
  207.  
  208. ; Use this option if you have a MySQL server with InnoDB support enabled
  209. ; but you do not plan to use it. This will save memory and disk space
  210. ; and speed up some things.
  211. ; skip-innodb
  212.  
  213. ; If set to 1, InnoDB will flush (fsync) the transaction logs to the
  214. ; disk at each commit, which offers full ACID behavior. If you are
  215. ; willing to compromise this safety, and you are running small
  216. ; transactions, you may set this to 0 or 2 to reduce disk I/O to the
  217. ; logs. Value 0 means that the log is only written to the log file and
  218. ; the log file flushed to disk approximately once per second. Value 2
  219. ; means the log is written to the log file at each commit, but the log
  220. ; file is only flushed to disk approximately once per second.
  221. ;innodb_flush_log_at_trx_commit=1
  222. innodb_flush_log_at_trx_commit=0
  223.  
  224. ; The size of the buffer InnoDB uses for buffering log data. As soon as
  225. ; it is full, InnoDB will have to flush it to disk. As it is flushed
  226. ; once per second anyway, it does not make sense to have it very large
  227. ; (even with long transactions).
  228. innodb_log_buffer_size=256K
  229.  
  230. ; InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
  231. ; row data. The bigger you set this the less disk I/O is needed to
  232. ; access data in tables. On a dedicated database server you may set this
  233. ; parameter up to 80% of the machine physical memory size. Do not set it
  234. ; too large, though, because competition of the physical memory may
  235. ; cause paging in the operating system. Note that on 32bit systems you
  236. ; might be limited to 2-3.5G of user level memory per process, so do not
  237. ; set it too high.
  238. innodb_buffer_pool_size=12G
  239.  
  240. ; Size of each log file in a log group. You should set the combined size
  241. ; of log files to about 25%-100% of your buffer pool size to avoid
  242. ; unneeded buffer pool flush activity on log file overwrite. However,
  243. ; note that a larger logfile size will increase the time needed for the
  244. ; recovery process.
  245. ;innodb_log_file_size=48M
  246. innodb_log_file_size=3G
  247.  
  248. ; Number of threads allowed inside the InnoDB kernel. The optimal value
  249. ; depends highly on the application, hardware as well as the OS
  250. ; scheduler properties. A too high value may lead to thread thrashing.
  251. innodb_thread_concurrency=25
  252.  
  253. ; The increment size (in MB) for extending the size of an auto-extend InnoDB system tablespace file when it becomes full.
  254. innodb_autoextend_increment=64
  255.  
  256. ; The number of regions that the InnoDB buffer pool is divided into.
  257. ; For systems with buffer pools in the multi-gigabyte range, dividing the buffer pool into separate instances can improve concurrency,
  258. ; by reducing contention as different threads read and write to cached pages.
  259. innodb_buffer_pool_instances=6
  260.  
  261. ; Determines the number of threads that can enter InnoDB concurrently.
  262. innodb_concurrency_tickets=5000
  263.  
  264. ; Specifies how long in milliseconds (ms) a block inserted into the old sublist must stay there after its first access before
  265. ; it can be moved to the new sublist.
  266. innodb_old_blocks_time=1000
  267.  
  268. ; It specifies the maximum number of .ibd files that MySQL can keep open at one time. The minimum value is 10.
  269. innodb_open_files=300
  270.  
  271. ; When this variable is enabled, InnoDB updates statistics during metadata statements.
  272. innodb_stats_on_metadata=0
  273.  
  274. ; When innodb_file_per_table is enabled (the default in 5.6.6 and higher), InnoDB stores the data and indexes for each newly created table
  275. ; in a separate .ibd file, rather than in the system tablespace.
  276. innodb_file_per_table=1
  277.  
  278. ; Use the following list of values: 0 for crc32, 1 for strict_crc32, 2 for innodb, 3 for strict_innodb, 4 for none, 5 for strict_none.
  279. innodb_checksum_algorithm=0
  280.  
  281. ; The number of outstanding connection requests MySQL can have.
  282. ; This option is useful when the main MySQL thread gets many connection requests in a very short time.
  283. ; It then takes some time (although very little) for the main thread to check the connection and start a new thread.
  284. ; The back_log value indicates how many requests can be stacked during this short time before MySQL momentarily
  285. ; stops answering new requests.
  286. ; You need to increase this only if you expect a large number of connections in a short period of time.
  287. back_log=80
  288.  
  289. ; If this is set to a nonzero value, all tables are closed every flush_time seconds to free up resources and
  290. ; synchronize unflushed data to disk.
  291. ; This option is best used only on systems with minimal resources.
  292. flush_time=0
  293.  
  294. ; The minimum size of the buffer that is used for plain index scans, range index scans, and joins that do not use
  295. ; indexes and thus perform full table scans.
  296. join_buffer_size=256K
  297.  
  298. ; The maximum size of one packet or any generated or intermediate string, or any parameter sent by the
  299. ; mysql_stmt_send_long_data() C API function.
  300. max_allowed_packet=4M
  301.  
  302. ; If more than this many successive connection requests from a host are interrupted without a successful connection,
  303. ; the server blocks that host from performing further connections.
  304. max_connect_errors=100
  305.  
  306. ; Changes the number of file descriptors available to mysqld.
  307. ; You should try increasing the value of this option if mysqld gives you the error "Too many open files".
  308. open_files_limit=4161
  309.  
  310. ; If you see many sort_merge_passes per second in SHOW GLOBAL STATUS output, you can consider increasing the
  311. ; sort_buffer_size value to speed up ORDER BY or GROUP BY operations that cannot be improved with query optimization
  312. ; or improved indexing.
  313. sort_buffer_size=256K
  314.  
  315. ; The number of table definitions (from .frm files) that can be stored in the definition cache.
  316. ; If you use a large number of tables, you can create a large table definition cache to speed up opening of tables.
  317. ; The table definition cache takes less space and does not use file descriptors, unlike the normal table cache.
  318. ; The minimum and default values are both 400.
  319. table_definition_cache=1400
  320.  
  321. ; Specify the maximum size of a row-based binary log event, in bytes.
  322. ; Rows are grouped into events smaller than this size if possible. The value should be a multiple of 256.
  323. binlog_row_event_max_size=8K
  324.  
  325. ; If the value of this variable is greater than 0, a replica synchronizes its master.info file to disk.
  326. ; (using fdatasync()) after every sync_master_info events.
  327. sync_master_info=10000
  328.  
  329. ; If the value of this variable is greater than 0, the MySQL server synchronizes its relay log to disk.
  330. ; (using fdatasync()) after every sync_relay_log writes to the relay log.
  331. sync_relay_log=10000
  332.  
  333. ; If the value of this variable is greater than 0, a replica synchronizes its relay-log.info file to disk.
  334. ; (using fdatasync()) after every sync_relay_log_info transactions.
  335. sync_relay_log_info=10000
  336.  
  337. ; Load mysql plugins at start."plugin_x ; plugin_y".
  338. ; plugin_load
  339.  
  340. ; The TCP/IP Port the MySQL Server X Protocol will listen on.
  341. loose_mysqlx_port=33060
  342.  
  343. ; wsl 20200806
  344.  
  345. innodb-doublewrite=0
  346. ;innodb_flush_log_at_timeout=60
  347.  
  348. net-read-timeout = 600
  349. net-write-timeout = 600
  350. connect-timeout = 3600
  351. mysqlx_write_timeout = 600
  352.  
  353.  
  354. ;wsl 20210203
  355. ;https://stackoverflow.com/questions/63432924/very-slow-writes-on-mysql-8-waiting-for-handler-commit
  356. ; innodb_lru_scan_depth=100 # from 1024 to conserve 90% CPU cycles used for function
  357. ; innodb_io_capacity=1900 # from 200 to allow more IOPSecond to your storage device
  358. innodb_flush_neighbors=0 # from 0 to expedite writing to current extent
  359.  
  360. ; innodb_innodb_max_dirty_pages_pct_lwm=10 # from 10 percent to expedite writes
  361. ; innodb_innodb_max_dirty_pages_pct=25 # from 90 percent to reduce innodb_buffer_pool_pages_dirty count
  362. ; innodb_change_buffer_max_size=50 # from 25 percent to expedite your high volume activity
  363.  
  364. ; https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_flush_neighbors
  365. innodb_flush_neighbors=0
  366. innodb_io_capacity_max=5000
  367. innodb_io_capacity=2500
  368. innodb_log_compressed_pages=OFF
  369.  
  370.  
  371. ; https://dba.stackexchange.com/questions/232365/mysql-8-0-updates-are-sometimes-stalling
  372. innodb_flush_log_at_trx_commit = 2
  373. ; range_optimizer_max_mem_size = 0
  374.  
  375.  
  376. ; https://dev.mysql.com/doc/refman/8.0/en/optimizing-innodb-diskio.html
  377. ; innodb_log_compressed_pages=0
  378.  
  379.  
  380. ; To disable binary logging, you can specify the --skip-log-bin or --disable-log-bin option at startup.
  381. ; If either of these options is specified and --log-bin is also specified, the option specified later takes precedence.
  382.  
  383. skip-log-bin = 1
  384.  
  385.  
  386. innodb_buffer_pool_dump_at_shutdown = on
  387.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement