System variables that are true or false can be enabled at server startup by naming them, or disabled by using a
--skip-prefix. For example, to enable or disable theInnoDBadaptive hash index, you can use--innodb_adaptive_hash_indexor--skip-innodb_adaptive_hash_indexon the command line, orinnodb_adaptive_hash_indexorskip-innodb_adaptive_hash_indexin an option file.System variables that take a numeric value can be specified as
--on the command line or asvar_name=valuein option files.var_name=valueMany system variables can be changed at runtime (see Section 6.1.6.2, “Dynamic System Variables”).
For information about
GLOBALandSESSIONvariable scope modifiers, refer to theSETstatement documentation.Certain options control the locations and layout of the
InnoDBdata files. Section 15.6.1, “InnoDB Startup Configuration” explains how to use these options.Some options, which you might not use initially, help tune
InnoDBperformance characteristics based on machine capacity and your database workload.For more information on specifying options and system variables, see Section 5.2.3, “Specifying Program Options”.
Table 15.11 InnoDB Option/Variable
Reference
InnoDB Command Options
-
Deprecated 5.5.22 Command-Line Format --ignore-builtin-innodbSystem Variable Name ignore_builtin_innodbVariable Scope Global Dynamic Variable No Permitted Values Type boolean In MySQL 5.1, this option caused the server to behave as if the built-in
InnoDBwere not present, which enabled theInnoDB Pluginto be used instead. In MySQL 5.7,InnoDBis the default storage engine andInnoDB Pluginis not used, so this option is ignored. -
Deprecated 5.7.5 Command-Line Format --innodb[=value]Permitted Values Type enumeration Default ONValid Values OFFONFORCEControls loading of the
InnoDBstorage engine, if the server was compiled withInnoDBsupport. This option has a tristate format, with possible values ofOFF,ON, orFORCE. See Section 6.5.2, “Installing and Uninstalling Plugins”.To disable
InnoDB, use--innodb=OFFor--skip-innodb. In this case, because the default storage engine isInnoDB, the server does not start unless you also use--default-storage-engineand--default-tmp-storage-engineto set the default to some other engine for both permanent andTEMPORARYtables.As of MySQL 5.7.5, the
InnoDBstorage engine can no longer be disabled, and the--innodb=OFFand--skip-innodboptions are deprecated and have no effect. Their use results in a warning. These options will be removed in a future MySQL release. -
Command-Line Format --innodb-status-filePermitted Values Type boolean Default OFFControls whether
InnoDBcreates a file namedinnodb_status.in the MySQL data directory. If enabled,pidInnoDBperiodically writes the output ofSHOW ENGINE INNODB STATUSto this file.By default, the file is not created. To create it, start mysqld with the
--innodb-status-file=1option. The file is deleted during normal shutdown. Disable the
InnoDBstorage engine. See the description of--innodb.
InnoDB System Variables
daemon_memcached_enable_binlogCommand-Line Format --daemon_memcached_enable_binlog=#System Variable Name daemon_memcached_enable_binlogVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default falseEnable this option on the master server to use the
InnoDBmemcached plugin (daemon_memcached) with the MySQL binary log. This option can only be set at server startup. You must also enable the MySQL binary log on the master server using the--log-binoption.For more information, see Section 15.20.6, “The InnoDB memcached Plugin and Replication”.
daemon_memcached_engine_lib_nameCommand-Line Format --daemon_memcached_engine_lib_name=librarySystem Variable Name daemon_memcached_engine_lib_nameVariable Scope Global Dynamic Variable No Permitted Values Type file name Default innodb_engine.soSpecifies the shared library that implements the
InnoDBmemcached plugin.For more information, see Section 15.20.3, “Setting Up the InnoDB memcached Plugin”.
daemon_memcached_engine_lib_pathCommand-Line Format --daemon_memcached_engine_lib_path=directorySystem Variable Name daemon_memcached_engine_lib_pathVariable Scope Global Dynamic Variable No Permitted Values Type directory name Default NULLThe path of the directory containing the shared library that implements the
InnoDBmemcached plugin. The default value is NULL, representing the MySQL plugin directory. You should not need to modify this parameter unless specifying amemcachedplugin for a different storage engine that is located outside of the MySQL plugin directory.For more information, see Section 15.20.3, “Setting Up the InnoDB memcached Plugin”.
-
Command-Line Format --daemon_memcached_option=optionsSystem Variable Name daemon_memcached_optionVariable Scope Global Dynamic Variable No Permitted Values Type string Default Used to pass space-separated memcached options to the underlying memcached memory object caching daemon on startup. For example, you might change the port that memcached listens on, reduce the maximum number of simultaneous connections, change the maximum memory size for a key/value pair, or enable debugging messages for the error log.
See Section 15.20.3, “Setting Up the InnoDB memcached Plugin” for usage details. For information about memcached options, refer to the memcached man page.
-
Command-Line Format --daemon_memcached_r_batch_size=#System Variable Name daemon_memcached_r_batch_sizeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 1Specifies how many memcached read operations (
getoperations) to perform before doing aCOMMITto start a new transaction. Counterpart ofdaemon_memcached_w_batch_size.This value is set to 1 by default, so that any changes made to the table through SQL statements are immediately visible to memcached operations. You might increase it to reduce the overhead from frequent commits on a system where the underlying table is only being accessed through the memcached interface. If you set the value too large, the amount of undo or redo data could impose some storage overhead, as with any long-running transaction.
For more information, see Section 15.20.3, “Setting Up the InnoDB memcached Plugin”.
-
Command-Line Format --daemon_memcached_w_batch_size=#System Variable Name daemon_memcached_w_batch_sizeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 1Specifies how many memcached write operations, such as
add,set, andincr, to perform before doing aCOMMITto start a new transaction. Counterpart ofdaemon_memcached_r_batch_size.This value is set to 1 by default, on the assumption that data being stored is important to preserve in case of an outage and should immediately be committed. When storing non-critical data, you might increase this value to reduce the overhead from frequent commits; but then the last
N-1 uncommitted write operations could be lost if a crash occurs.For more information, see Section 15.20.3, “Setting Up the InnoDB memcached Plugin”.
-
Deprecated 5.5.22 Command-Line Format --ignore-builtin-innodbSystem Variable Name ignore_builtin_innodbVariable Scope Global Dynamic Variable No Permitted Values Type boolean See the description of
--ignore-builtin-innodbunder “InnoDB Command Options” earlier in this section. -
Command-Line Format --innodb_adaptive_flushing=#System Variable Name innodb_adaptive_flushingVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default ONSpecifies whether to dynamically adjust the rate of flushing dirty pages in the
InnoDBbuffer pool based on the workload. Adjusting the flush rate dynamically is intended to avoid bursts of I/O activity. This setting is enabled by default. See Section 15.6.3.6, “Configuring InnoDB Buffer Pool Flushing” for more information. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”. -
Command-Line Format --innodb_adaptive_flushing_lwm=#System Variable Name innodb_adaptive_flushing_lwmVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 10Min Value 0Max Value 70Defines the low water mark representing percentage of redo log capacity at which adaptive flushing is enabled. For more information, see Section 15.6.3.7, “Fine-tuning InnoDB Buffer Pool Flushing”.
-
Command-Line Format --innodb_adaptive_hash_index=#System Variable Name innodb_adaptive_hash_indexVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default ONWhether the
InnoDBadaptive hash index is enabled or disabled. It may be desirable, depending on your workload, to dynamically enable or disable adaptive hash indexing to improve query performance. Because the adaptive hash index may not be useful for all workloads, conduct benchmarks with it both enabled and disabled, using realistic workloads. See Section 15.4.3, “Adaptive Hash Index” for details.This variable is enabled by default. You can modify this parameter using the
SET GLOBALstatement, without restarting the server. Changing the setting requires theSUPERprivilege. You can also use--skip-innodb_adaptive_hash_indexat server startup to disable it.Disabling the adaptive hash index empties the hash table immediately. Normal operations can continue while the hash table is emptied, and executing queries that were using the hash table access the index B-trees directly instead. When the adaptive hash index is re-enabled, the hash table is populated again during normal operation.
innodb_adaptive_hash_index_partsIntroduced 5.7.8 Command-Line Format --innodb_adaptive_hash_index_parts=#System Variable Name innodb_adaptive_hash_index_partsVariable Scope Global Dynamic Variable No Permitted Values Type numeric Default 8Min Value 1Max Value 512Partitions the adaptive hash index search system. Each index is bound to a specific partition, with each partition protected by a separate latch.
Prior to MySQL 5.7.8, the adaptive hash index search system was protected by a single latch (
btr_search_latch) which could become a point of contention. With the introduction of theinnodb_adaptive_hash_index_partsoption, the search system is partitioned into 8 parts by default. The maximum setting is 512.For related information, see Section 15.4.3, “Adaptive Hash Index”.
innodb_adaptive_max_sleep_delayCommand-Line Format --innodb_adaptive_max_sleep_delay=#System Variable Name innodb_adaptive_max_sleep_delayVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 150000Min Value 0Max Value 1000000Permits
InnoDBto automatically adjust the value ofinnodb_thread_sleep_delayup or down according to the current workload. Any non-zero value enables automated, dynamic adjustment of theinnodb_thread_sleep_delayvalue, up to the maximum value specified in theinnodb_adaptive_max_sleep_delayoption. The value represents the number of microseconds. This option can be useful in busy systems, with greater than 16InnoDBthreads. (In practice, it is most valuable for MySQL systems with hundreds or thousands of simultaneous connections.)For more information, see Section 15.6.6, “Configuring Thread Concurrency for InnoDB”.
innodb_additional_mem_pool_sizeDeprecated 5.6.3 Removed 5.7.4 Command-Line Format --innodb_additional_mem_pool_size=#System Variable Name innodb_additional_mem_pool_sizeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 8388608Min Value 2097152Max Value 4294967295The size in bytes of a memory pool
InnoDBuses to store data dictionary information and other internal data structures. The more tables you have in your application, the more memory you allocate here. IfInnoDBruns out of memory in this pool, it starts to allocate memory from the operating system and writes warning messages to the MySQL error log. The default value is 8MB.This variable relates to the
InnoDBinternal memory allocator, which is unused ifinnodb_use_sys_mallocis enabled. For more information, see Section 15.6.4, “Configuring the Memory Allocator for InnoDB”.innodb_additional_mem_pool_sizewas deprecated in MySQL 5.6.3 and removed in MySQL 5.7.4.-
Command-Line Format --innodb_api_bk_commit_interval=#System Variable Name innodb_api_bk_commit_intervalVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 5Min Value 1Max Value 1073741824How often to auto-commit idle connections that use the
InnoDBmemcached interface, in seconds. For more information, see Section 15.20.5.4, “Controlling Transactional Behavior of the InnoDB memcached Plugin”. -
Command-Line Format --innodb_api_disable_rowlock=#System Variable Name innodb_api_disable_rowlockVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default OFFUse this option to disable row locks when
InnoDBmemcached performs DML operations. By default,innodb_api_disable_rowlockis disabled, which means that memcached requests row locks forgetandsetoperations. Wheninnodb_api_disable_rowlockis enabled, memcached requests a table lock instead of row locks.innodb_api_disable_rowlockis not dynamic. It must be specified on the mysqld command line or entered in the MySQL configuration file. Configuration takes effect when the plugin is installed, which occurs when the MySQL server is started.For more information, see Section 15.20.5.4, “Controlling Transactional Behavior of the InnoDB memcached Plugin”.
-
Command-Line Format --innodb_api_enable_binlog=#System Variable Name innodb_api_enable_binlogVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default OFFLets you use the
InnoDBmemcached plugin with the MySQL binary log. For more information, see Enabling the InnoDB memcached Binary Log. -
Command-Line Format --innodb_api_enable_mdl=#System Variable Name innodb_api_enable_mdlVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default OFFLocks the table used by the
InnoDBmemcached plugin, so that it cannot be dropped or altered by DDL through the SQL interface. For more information, see Section 15.20.5.4, “Controlling Transactional Behavior of the InnoDB memcached Plugin”. -
Command-Line Format --innodb_api_trx_level=#System Variable Name innodb_api_trx_levelVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 0Controls the transaction isolation level on queries processed by the memcached interface. The constants corresponding to the familiar names are:
0 =
READ UNCOMMITTED1 =
READ COMMITTED2 =
REPEATABLE READ3 =
SERIALIZABLE
For more information, see Section 15.20.5.4, “Controlling Transactional Behavior of the InnoDB memcached Plugin”.
-
Command-Line Format --innodb_autoextend_increment=#System Variable Name innodb_autoextend_incrementVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 64Min Value 1Max Value 1000The increment size (in megabytes) for extending the size of an auto-extending
InnoDBsystem tablespace file when it becomes full. The default value is 64. For related information, see System Tablespace Data File Configuration, and Section 15.7.1, “Resizing the InnoDB System Tablespace”.The
innodb_autoextend_incrementsetting does not affect file-per-table tablespace files or general tablespace files. These files are auto-extending regardless of theinnodb_autoextend_incrementsetting. The initial extensions are by small amounts, after which extensions occur in increments of 4MB. -
Command-Line Format --innodb_autoinc_lock_mode=#System Variable Name innodb_autoinc_lock_modeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 1Valid Values 012The lock mode to use for generating auto-increment values. Permissible values are 0, 1, or 2, for “traditional”, “consecutive”, or “interleaved”, respectively. The default setting is 1 (“consecutive”). For the characteristics of each lock mode, see InnoDB AUTO_INCREMENT Lock Modes.
innodb_background_drop_list_emptyIntroduced 5.7.10 Command-Line Format --innodb_background_drop_list_empty=#System Variable Name innodb_background_drop_list_emptyVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFEnabling the
innodb_background_drop_list_emptydebug option helps avoid test case failures by delaying table creation until the background drop list is empty. For example, if test case A places tablet1on the background drop list, test case B waits until the background drop list is empty before creating tablet1.-
Introduced 5.7.5 Command-Line Format --innodb_buffer_pool_chunk_sizeSystem Variable Name innodb_buffer_pool_chunk_sizeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 134217728Min Value 1048576Max Value innodb_buffer_pool_size / innodb_buffer_pool_instancesinnodb_buffer_pool_chunk_sizedefines the chunk size forInnoDBbuffer pool resizing operations. Theinnodb_buffer_pool_sizeparameter is dynamic, which allows you to resize the buffer pool without restarting the server.To avoid copying all buffer pool pages during resizing operations, the operation is performed in “chunks”. By default,
innodb_buffer_pool_chunk_sizeis 128MB (134217728 bytes). The number of pages contained in a chunk depends on the value ofinnodb_page_size.innodb_buffer_pool_chunk_sizecan be increased or decreased in units of 1MB (1048576 bytes).The following conditions apply when altering the
innodb_buffer_pool_chunk_sizevalue:If
innodb_buffer_pool_chunk_size*innodb_buffer_pool_instancesis larger than the current buffer pool size when the buffer pool is initialized,innodb_buffer_pool_chunk_sizeis truncated toinnodb_buffer_pool_size/innodb_buffer_pool_instances.Buffer pool size must always be equal to or a multiple of
innodb_buffer_pool_chunk_size*innodb_buffer_pool_instances. If you alterinnodb_buffer_pool_chunk_size,innodb_buffer_pool_sizeis automatically adjusted to a value that is equal to or a multiple ofinnodb_buffer_pool_chunk_size*innodb_buffer_pool_instancesthat is not less than the current buffer pool size. The adjustment occurs when the buffer pool is initialized.
ImportantCare should be taken when changing
innodb_buffer_pool_chunk_size, as changing this value can automatically increase the size of the buffer pool. Before changinginnodb_buffer_pool_chunk_size, calculate the effect it will have oninnodb_buffer_pool_sizeto ensure that the resulting buffer pool size is acceptable.To avoid potential performance issues, the number of chunks (
innodb_buffer_pool_size/innodb_buffer_pool_chunk_size) should not exceed 1000.See Section 15.6.3.2, “Configuring InnoDB Buffer Pool Size” for more information.
innodb_buffer_pool_dump_at_shutdownCommand-Line Format --innodb_buffer_pool_dump_at_shutdown=#System Variable Name innodb_buffer_pool_dump_at_shutdownVariable Scope Global Dynamic Variable Yes Permitted Values (<= 5.7.6) Type boolean Default OFFPermitted Values (>= 5.7.7) Type boolean Default ONSpecifies whether to record the pages cached in the
InnoDBbuffer pool when the MySQL server is shut down, to shorten the warmup process at the next restart. Typically used in combination withinnodb_buffer_pool_load_at_startup. Theinnodb_buffer_pool_dump_pctoption defines the percentage of most recently used buffer pool pages to dump.Both
innodb_buffer_pool_dump_at_shutdownandinnodb_buffer_pool_load_at_startupare enabled by default as of MySQL 5.7.7.For more information, see Section 15.6.3.8, “Saving and Restoring the Buffer Pool State”.
-
Command-Line Format --innodb_buffer_pool_dump_now=#System Variable Name innodb_buffer_pool_dump_nowVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFImmediately records the pages cached in the
InnoDBbuffer pool. Typically used in combination withinnodb_buffer_pool_load_now.For more information, see Section 15.6.3.8, “Saving and Restoring the Buffer Pool State”.
-
Introduced 5.7.2 Command-Line Format --innodb_buffer_pool_dump_pct=#System Variable Name innodb_buffer_pool_dump_pctVariable Scope Global Dynamic Variable Yes Permitted Values (<= 5.7.6) Type integer Default 100Min Value 1Max Value 100Permitted Values (>= 5.7.7) Type integer Default 25Min Value 1Max Value 100Specifies the percentage of the most recently used pages for each buffer pool to read out and dump. The range is 1 to 100. Prior to MySQL 5.7.7, the default value is 100 (dump all pages). As of MySQL 5.7.7, the default value is 25. For example, if there are 4 buffer pools with 100 pages each, and
innodb_buffer_pool_dump_pctis set to 25, the 25 most recently used pages from each buffer pool are dumped.The change to the
innodb_buffer_pool_dump_pctdefault value in MySQL 5.7.7 coincides with default value changes forinnodb_buffer_pool_dump_at_shutdownandinnodb_buffer_pool_load_at_startup, which are both enabled by default as of MySQL 5.7.7. -
Command-Line Format --innodb_buffer_pool_filename=fileSystem Variable Name innodb_buffer_pool_filenameVariable Scope Global Dynamic Variable Yes Permitted Values Type file name Default ib_buffer_poolSpecifies the name of the file that holds the list of tablespace IDs and page IDs produced by
innodb_buffer_pool_dump_at_shutdownorinnodb_buffer_pool_dump_now. Tablespace IDs and page IDs are saved in the following format:space, page_id. By default, the file is namedib_buffer_pooland is located in theInnoDBdata directory. A non-default location must be specified relative to the data directory.A file name can be specified at runtime, using a
SETstatement:SET GLOBAL innodb_buffer_pool_filename=
'file_name';You can also specify a file name at startup, in a startup string or MySQL configuration file. When specifying a file name at startup, the file must exist or
InnoDBwill return a startup error indicating that there is no such file or directory.For more information, see Section 15.6.3.8, “Saving and Restoring the Buffer Pool State”.
-
Command-Line Format --innodb_buffer_pool_instances=#System Variable Name innodb_buffer_pool_instancesVariable Scope Global Dynamic Variable No Permitted Values (Windows, 32-bit platforms) Type integer Default (autosized)Min Value 1Max Value 64Permitted Values (Other) Type integer Default 8 (or 1 if innodb_buffer_pool_size < 1GBMin Value 1Max Value 64The number of regions that the
InnoDBbuffer pool is divided into. For systems with buffer pools in the multi-gigabyte range, dividing the buffer pool into separate instances can improve concurrency, by reducing contention as different threads read and write to cached pages. Each page that is stored in or read from the buffer pool is assigned to one of the buffer pool instances randomly, using a hashing function. Each buffer pool manages its own free lists, flush lists, LRUs, and all other data structures connected to a buffer pool, and is protected by its own buffer pool mutex.This option only takes effect when setting
innodb_buffer_pool_sizeto 1GB or more. The total buffer pool size is divided among all the buffer pools. For best efficiency, specify a combination ofinnodb_buffer_pool_instancesandinnodb_buffer_pool_sizeso that each buffer pool instance is at least 1GB.The default value on 32-bit Windows systems depends on the value of
innodb_buffer_pool_size, as described below:If
innodb_buffer_pool_sizeis greater than 1.3GB, the default forinnodb_buffer_pool_instancesisinnodb_buffer_pool_size/128MB, with individual memory allocation requests for each chunk. 1.3GB was chosen as the boundary at which there is significant risk for 32-bit Windows to be unable to allocate the contiguous address space needed for a single buffer pool.Otherwise, the default is 1.
On all other platforms, the default value is 8 when
innodb_buffer_pool_sizeis greater than or equal to 1GB. Otherwise, the default is 1.For related information, see Section 15.6.3.2, “Configuring InnoDB Buffer Pool Size”.
-
Command-Line Format --innodb_buffer_pool_load_abort=#System Variable Name innodb_buffer_pool_load_abortVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFInterrupts the process of restoring
InnoDBbuffer pool contents triggered byinnodb_buffer_pool_load_at_startuporinnodb_buffer_pool_load_now.For more information, see Section 15.6.3.8, “Saving and Restoring the Buffer Pool State”.
innodb_buffer_pool_load_at_startupCommand-Line Format --innodb_buffer_pool_load_at_startup=#System Variable Name innodb_buffer_pool_load_at_startupVariable Scope Global Dynamic Variable No Permitted Values (<= 5.7.6) Type boolean Default OFFPermitted Values (>= 5.7.7) Type boolean Default ONSpecifies that, on MySQL server startup, the
InnoDBbuffer pool is automatically warmed up by loading the same pages it held at an earlier time. Typically used in combination withinnodb_buffer_pool_dump_at_shutdown.Both
innodb_buffer_pool_dump_at_shutdownandinnodb_buffer_pool_load_at_startupare enabled by default as of MySQL 5.7.7.For more information, see Section 15.6.3.8, “Saving and Restoring the Buffer Pool State”.
-
Command-Line Format --innodb_buffer_pool_load_now=#System Variable Name innodb_buffer_pool_load_nowVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFImmediately warms up the
InnoDBbuffer pool by loading a set of data pages, without waiting for a server restart. Can be useful to bring cache memory back to a known state during benchmarking, or to ready the MySQL server to resume its normal workload after running queries for reports or maintenance.For more information, see Section 15.6.3.8, “Saving and Restoring the Buffer Pool State”.
-
Command-Line Format --innodb_buffer_pool_size=#System Variable (<= 5.7.4) Name innodb_buffer_pool_sizeVariable Scope Global Dynamic Variable No System Variable (>= 5.7.5) Name innodb_buffer_pool_sizeVariable Scope Global Dynamic Variable Yes Permitted Values (32-bit platforms) Type integer Default 134217728Min Value 5242880Max Value 2**32-1Permitted Values (64-bit platforms) Type integer Default 134217728Min Value 5242880Max Value 2**64-1The size in bytes of the buffer pool, the memory area where
InnoDBcaches table and index data. The default value is 128MB. The maximum value depends on the CPU architecture; the maximum is 4294967295 (232-1) on 32-bit systems and 18446744073709551615 (264-1) on 64-bit systems. On 32-bit systems, the CPU architecture and operating system may impose a lower practical maximum size than the stated maximum. When the size of the buffer pool is greater than 1GB, settinginnodb_buffer_pool_instancesto a value greater than 1 can improve the scalability on a busy server.A larger buffer pool requires less disk I/O to access the same table data more than once. On a dedicated database server, you might set the buffer pool size to 80% of the machine's physical memory size. Be aware of the following potential issues when configuring buffer pool size, and be prepared to scale back the size of the buffer pool if necessary.
Competition for physical memory can cause paging in the operating system.
InnoDBreserves additional memory for buffers and control structures, so that the total allocated space is approximately 10% greater than the specified buffer pool size.Address space for the buffer pool must be contiguous, which can be an issue on Windows systems with DLLs that load at specific addresses.
The time to initialize the buffer pool is roughly proportional to its size. On instances with large buffer pools, initialization time might be significant. To reduce the initialization period, you can save the buffer pool state at server shutdown and restore it at server startup. See Section 15.6.3.8, “Saving and Restoring the Buffer Pool State”.
When you increase or decrease buffer pool size, the operation is performed in chunks. Chunk size is defined by the
innodb_buffer_pool_chunk_sizeconfiguration option, which has a default of 128 MB.Buffer pool size must always be equal to or a multiple of
innodb_buffer_pool_chunk_size*innodb_buffer_pool_instances. If you alter the buffer pool size to a value that is not equal to or a multiple ofinnodb_buffer_pool_chunk_size*innodb_buffer_pool_instances, buffer pool size is automatically adjusted to a value that is equal to or a multiple ofinnodb_buffer_pool_chunk_size*innodb_buffer_pool_instancesthat is not less than the specified buffer pool size.innodb_buffer_pool_sizecan be set dynamically, which allows you to resize the buffer pool without restarting the server. TheInnodb_buffer_pool_resize_statusstatus variable reports the status of online buffer pool resizing operations. See Section 15.6.3.2, “Configuring InnoDB Buffer Pool Size” for more information. -
Command-Line Format --innodb_change_buffer_max_size=#System Variable Name innodb_change_buffer_max_sizeVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 25Min Value 0Max Value 50Maximum size for the
InnoDBchange buffer, as a percentage of the total size of the buffer pool. You might increase this value for a MySQL server with heavy insert, update, and delete activity, or decrease it for a MySQL server with unchanging data used for reporting. For more information, see Section 15.4.2, “Change Buffer”, and Section 15.6.5, “Configuring InnoDB Change Buffering”. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”. -
Command-Line Format --innodb_change_buffering=#System Variable Name innodb_change_bufferingVariable Scope Global Dynamic Variable Yes Permitted Values Type enumeration Default allValid Values noneinsertsdeleteschangespurgesallWhether
InnoDBperforms change buffering, an optimization that delays write operations to secondary indexes so that the I/O operations can be performed sequentially. Permitted values are described in the following table.Table 15.12 Permitted Values for innodb_change_buffering
Value Description noneDo not buffer any operations. insertsBuffer insert operations. deletesBuffer delete marking operations; strictly speaking, the writes that mark index records for later deletion during a purge operation. changesBuffer inserts and delete-marking operations. purgesBuffer the physical deletion operations that happen in the background. allThe default. Buffer inserts, delete-marking operations, and purges. For more information, see Section 15.4.2, “Change Buffer”, and Section 15.6.5, “Configuring InnoDB Change Buffering”. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.
-
Command-Line Format --innodb_change_buffering_debug=#System Variable Name innodb_change_buffering_debugVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 0Max Value 2Sets a debug flag for
InnoDBchange buffering. A value of 1 forces all changes to the change buffer. A value of 2 causes a crash at merge. A default value of 0 indicates that the change buffering debug flag is not set. This option is only available when debugging support is compiled in using theWITH_DEBUGCMake option. -
Command-Line Format --innodb_checksum_algorithm=#System Variable Name innodb_checksum_algorithmVariable Scope Global Dynamic Variable Yes Permitted Values (<= 5.7.6) Type enumeration Default innodbValid Values innodbcrc32nonestrict_innodbstrict_crc32strict_nonePermitted Values (>= 5.7.7) Type enumeration Default crc32Valid Values innodbcrc32nonestrict_innodbstrict_crc32strict_noneSpecifies how to generate and verify the checksum stored in the disk blocks of
InnoDBtablespaces.The default value for
innodb_checksum_algorithmchanged frominnodbtocrc32in MySQL 5.6.6 but switched back toinnodbin 5.6.7 for improved compatibility ofInnoDBdata files during a downgrade to an earlier MySQL version, and for use with MySQL Enterprise Backup. The limitations encountered included:.ibdfiles containing CRC32 checksums could cause problems downgrading to MySQL versions prior to 5.6.3. MySQL 5.6.3 and up recognizes either the new or old checksum values for the block as correct when reading the block from disk, ensuring that data blocks are compatible during upgrade and downgrade regardless of the algorithm setting. If data written with new checksum values is processed by a level of MySQL earlier than 5.6.3, it could be reported as corrupted.Versions of MySQL Enterprise Backup up to 3.8.0 do not support backing up tablespaces that use CRC32 checksums. MySQL Enterprise Backup adds CRC32 checksum support in 3.8.1, with some limitations. Refer to the MySQL Enterprise Backup 3.8.1 Change History for more information.
As of MySQL 5.7.7,
crc32is once again the default value forinnodb_checksum_algorithm.innodb_checksum_algorithmreplaced theinnodb_checksumsoption in MySQL 5.6.3. The following values were provided for compatibility, up to and including MySQL 5.7.6:innodb_checksums=ONis the same asinnodb_checksum_algorithm=innodb.innodb_checksums=OFFis the same asinnodb_checksum_algorithm=none.
As of MySQl 5.7.7, with a default
innodb_checksum_algorithmvalue of crc32,innodb_checksums=ONis now the same asinnodb_checksum_algorithm=crc32.innodb_checksums=OFFis still the same asinnodb_checksum_algorithm=none.To avoid conflicts, remove references to
innodb_checksumsfrom MySQL configuration files and startup scripts.The value
innodbis backward-compatible with earlier versions of MySQL. The valuecrc32uses an algorithm that is faster to compute the checksum for every modified block, and to check the checksums for each disk read. It scans blocks 32 bits at a time, which is faster than theinnodbchecksum algorithm, which scans blocks 8 bits at a time. The valuenonewrites a constant value in the checksum field rather than computing a value based on the block data. The blocks in a tablespace can use a mix of old, new, and no checksum values, being updated gradually as the data is modified; once blocks in a tablespace are modified to use thecrc32algorithm, the associated tables cannot be read by earlier versions of MySQL.The strict form of a checksum algorithm reports an error if it encounters a valid but non-matching checksum value in a tablespace. It is recommended that you only use strict settings in a new instance, to set up tablespaces for the first time. Strict settings are somewhat faster, because they do not need to compute all checksum values during disk reads.
NotePrior to MySQL 5.7.8, a strict mode setting for
innodb_checksum_algorithmcausedInnoDBto halt when encountering a valid but non-matching checksum. In MySQL 5.7.8 and later, only an error message is printed, and the page is accepted as valid if it has a validinnodb,crc32ornonechecksum.The following table shows the difference between the
none,innodb, andcrc32option values, and their strict counterparts.none,innodb, andcrc32write the specified type of checksum value into each data block, but for compatibility accept other checksum values when verifying a block during a read operation. Strict settings also accept valid checksum values but print an error message when a valid non-matching checksum value is encountered. Using the strict form can make verification faster if allInnoDBdata files in an instance are created under an identicalinnodb_checksum_algorithmvalue.Table 15.13 innodb_checksum_algorithm Settings
Value Generated checksum (when writing) Permitted checksums (when reading) none A constant number. Any of the checksums generated by none,innodb, orcrc32.innodb A checksum calculated in software, using the original algorithm from InnoDB.Any of the checksums generated by none,innodb, orcrc32.crc32 A checksum calculated using the crc32algorithm, possibly done with a hardware assist.Any of the checksums generated by none,innodb, orcrc32.strict_none A constant number Any of the checksums generated by none,innodb, orcrc32.InnoDBprints an error message if a valid but non-matching checksum is encountered.strict_innodb A checksum calculated in software, using the original algorithm from InnoDB.Any of the checksums generated by none,innodb, orcrc32.InnoDBprints an error message if a valid but non-matching checksum is encountered.strict_crc32 A checksum calculated using the crc32algorithm, possibly done with a hardware assist.Any of the checksums generated by none,innodb, orcrc32.InnoDBprints an error message if a valid but non-matching checksum is encountered. -
Deprecated 5.6.3 Command-Line Format --innodb_checksumsSystem Variable Name innodb_checksumsVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default ONInnoDBcan use checksum validation on all tablespace pages read from the disk to ensure extra fault tolerance against hardware faults or corrupted data files. This validation is enabled by default. Under specialized circumstances (such as when running benchmarks) this extra safety feature can be disabled with--skip-innodb-checksums. You can specify the method of calculating the checksum withinnodb_checksum_algorithm.In MySQL 5.6.3 and higher,
innodb_checksumsis deprecated, replaced byinnodb_checksum_algorithm.Prior to MySQL 5.7.7,
innodb_checksums=ONis the same asinnodb_checksum_algorithm=innodb. As of MySQL 5.7.7, theinnodb_checksum_algorithmdefault value iscrc32, andinnodb_checksums=ONis the same asinnodb_checksum_algorithm=crc32.innodb_checksums=OFFis the same asinnodb_checksum_algorithm=none.It is recommended that you remove any
innodb_checksumsoptions from your configuration files and startup scripts, to avoid conflicts withinnodb_checksum_algorithm.innodb_checksums=OFFautomatically setsinnodb_checksum_algorithm=none.innodb_checksums=ONis ignored and overridden by any other setting forinnodb_checksum_algorithm. -
Command-Line Format --innodb_cmp_per_index_enabled=#System Variable Name innodb_cmp_per_index_enabledVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFValid Values OFFONEnables per-index compression-related statistics in the
INFORMATION_SCHEMA.INNODB_CMP_PER_INDEXtable. Because these statistics can be expensive to gather, only enable this option on development, test, or slave instances during performance tuning related toInnoDBcompressed tables. -
Command-Line Format --innodb_commit_concurrency=#System Variable Name innodb_commit_concurrencyVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 0Min Value 0Max Value 1000The number of threads that can commit at the same time. A value of 0 (the default) permits any number of transactions to commit simultaneously.
The value of
innodb_commit_concurrencycannot be changed at runtime from zero to nonzero or vice versa. The value can be changed from one nonzero value to another. -
Introduced 5.7.8 Command-Line Format --innodb_compress_debug=#System Variable Name innodb_compress_debugVariable Scope Global Dynamic Variable Yes Permitted Values Type enumeration Default noneValid Values nonezliblz4lz4hcCompresses all tables using a specified compression algorithm without having to define a
COMPRESSIONattribute for each table. This option is only available if debugging support is compiled in using theWITH_DEBUGCMake option. innodb_compression_failure_threshold_pctCommand-Line Format --innodb_compression_failure_threshold_pct=#System Variable Name innodb_compression_failure_threshold_pctVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 5Min Value 0Max Value 100Sets the cutoff point at which MySQL begins adding padding within compressed pages to avoid expensive compression failures. A value of zero disables the mechanism that monitors compression efficiency and dynamically adjusts the padding amount.
For more information, see Section 15.9.1.6, “Compression for OLTP Workloads”.
-
Command-Line Format --innodb_compression_level=#System Variable Name innodb_compression_levelVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 6Min Value 0Max Value 9Specifies the level of zlib compression to use for
InnoDBcompressed tables and indexes.For more information, see Section 15.9.1.6, “Compression for OLTP Workloads”.
innodb_compression_pad_pct_maxCommand-Line Format --innodb_compression_pad_pct_max=#System Variable Name innodb_compression_pad_pct_maxVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 50Min Value 0Max Value 75Specifies the maximum percentage that can be reserved as free space within each compressed page, allowing room to reorganize the data and modification log within the page when a compressed table or index is updated and the data might be recompressed. Only applies when
innodb_compression_failure_threshold_pctis set to a non-zero value, and the rate of compression failures passes the cutoff point.For more information, see Section 15.9.1.6, “Compression for OLTP Workloads”.
-
Command-Line Format --innodb_concurrency_tickets=#System Variable Name innodb_concurrency_ticketsVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 5000Min Value 1Max Value 4294967295Determines the number of threads that can enter
InnoDBconcurrently. A thread is placed in a queue when it tries to enterInnoDBif the number of threads has already reached the concurrency limit. When a thread is permitted to enterInnoDB, it is given a number of “free tickets” equal to the value ofinnodb_concurrency_tickets, and the thread can enter and leaveInnoDBfreely until it has used up its tickets. After that point, the thread again becomes subject to the concurrency check (and possible queuing) the next time it tries to enterInnoDB. The default value is 5000.With a small
innodb_concurrency_ticketsvalue, small transactions that only need to process a few rows compete fairly with larger transactions that process many rows. The disadvantage of a smallinnodb_concurrency_ticketsvalue is that large transactions must loop through the queue many times before they can complete, which extends the length of time required to complete their task.With a large
innodb_concurrency_ticketsvalue, large transactions spend less time waiting for a position at the end of the queue (controlled byinnodb_thread_concurrency) and more time retrieving rows. Large transactions also require fewer trips through the queue to complete their task. The disadvantage of a largeinnodb_concurrency_ticketsvalue is that too many large transactions running at the same time can starve smaller transactions by making them wait a longer time before executing.With a non-zero
innodb_thread_concurrencyvalue, you may need to adjust theinnodb_concurrency_ticketsvalue up or down to find the optimal balance between larger and smaller transactions. TheSHOW ENGINE INNODB STATUSreport shows the number of tickets remaining for an executing transaction in its current pass through the queue. This data may also be obtained from theTRX_CONCURRENCY_TICKETScolumn of theINFORMATION_SCHEMA.INNODB_TRXtable.For more information, see Section 15.6.6, “Configuring Thread Concurrency for InnoDB”.
-
Introduced 5.7.5 Removed 5.7.6 Command-Line Format --innodb_create_intrinsic=#System Variable Name innodb_create_intrinsicVariable Scope Session Dynamic Variable Yes Permitted Values Type boolean Default OFFWhen
innodb_create_intrinsicis enabled,CREATE TEMPORY TABLEcreates “optimized temporary tables” instead of normal temporary tables.An optimized temporary table is a lightweight subclass of temporary table that excludes certain functionality and benefits from optimizations that makes it faster than a normal temporary table. Like normal temporary tables, optimized temporary tables are only visible to the current connection, and are dropped when the connection is terminated. Unlike normal temporary tables, optimized temporary tables are operational when
InnoDBis in read-only mode.Row format
COMPRESSEDis not supported. If you attempt to create a compressed optimized temporary table, theinnodb_create_intrinsic=ONsetting is ignored andInnoDBcreates a normal temporary table.Optimized temporary table metadata is not available in the
INFORMATION_SCHEMA.INNODB_TEMP_TABLE_INFOtable.Undo logging is disabled for optimized temporary tables, which means that rollback is also not supported.
Atomicity for optimized temporary tables is supported at the row-level, not at the statement level.
Statistics generated by the same workload may differ for intrinsic temporary tables compared to normal temporary tables, as optimized temporary tables may use a different algorithm to complete certain types of operations.
innodb_create_intrinsicwas removed in MySQL 5.7.6. -
Command-Line Format --innodb_data_file_path=nameSystem Variable Name innodb_data_file_pathVariable Scope Global Dynamic Variable No Permitted Values Type string Default ibdata1:12M:autoextendThe paths to individual
InnoDBdata files and their sizes. The full directory path to each data file is formed by concatenatinginnodb_data_home_dirto each path specified here. The file sizes are specified KB, MB or GB (1024MB) by appendingK,MorGto the size value. If specifying data file size in kilobytes (KB), do so in multiples of 1024. Otherwise, KB values are rounded off to nearest megabyte (MB) boundary. The sum of the sizes of the files must be at least slightly larger than 10MB. If you do not specifyinnodb_data_file_path, the default behavior is to create a single auto-extending data file, slightly larger than 12MB, namedibdata1. The size limit of individual files is determined by your operating system. You can set the file size to more than 4GB on those operating systems that support big files. You can also use raw disk partitions as data files. For detailed information on configuringInnoDBtablespace files, see Section 15.6, “InnoDB Configuration”.As of MySQL 5.7.8, the following minimum file sizes are enforced for the first system tablespace data file (
ibdata1) to ensure that there is enough space for doublewrite buffer blocks (Bug #20972309):For an
innodb_page_sizevalue of 16KB or less, the minimum data file size is 3MB.For an
innodb_page_sizevalue of 32KB, the minimum data file size is 6MB.For an
innodb_page_sizevalue of 64KB, the minimum data file size is 12MB.
-
Command-Line Format --innodb_data_home_dir=dir_nameSystem Variable Name innodb_data_home_dirVariable Scope Global Dynamic Variable No Permitted Values Type directory name The common part of the directory path for all
InnoDBdata files in the system tablespace. This setting does not affect the location of file-per-table tablespaces wheninnodb_file_per_tableis enabled. The default value is the MySQLdatadirectory. If you specify the value as an empty string, you can use absolute file paths ininnodb_data_file_path. -
Introduced 5.7.15 Command-Line Format --innodb_deadlock_detectSystem Variable Name innodb_deadlock_detectVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default ONThis option is used to disable deadlock detection. On high concurrency systems, deadlock detection can cause a slowdown when numerous threads wait for the same lock. At times, it may be more efficient to disable deadlock detection and rely on the
innodb_lock_wait_timeoutsetting for transaction rollback when a deadlock occurs. -
Introduced 5.7.9 Command-Line Format --innodb_default_row_format=#System Variable Name innodb_default_row_formatVariable Scope Global Dynamic Variable Yes Permitted Values Type enumeration Default DYNAMICValid Values DYNAMICCOMPACTREDUNDANTThe
innodb_default_row_formatoption, introduced in MySQL 5.7.9, defines the default row format forInnoDBtables (including user-createdInnoDBtemporary tables). The default setting isDYNAMIC. Other permitted values areCOMPACTandREDUNDANT. TheCOMPRESSEDrow format, which is not supported for use in the system tablespace, cannot be defined as the default.Newly created tables use the row format defined by
innodb_default_row_formatwhen aROW_FORMAToption is not specified explicitly or whenROW_FORMAT=DEFAULTis used.When a
ROW_FORMAToption is not specified explicitly or whenROW_FORMAT=DEFAULTis used, any operation that rebuilds a table also silently changes the row format of the table to the format defined byinnodb_default_row_format. For more information, see Section 15.11.2, “Specifying the Row Format for a Table”.Internal
InnoDBtemporary tables created by the server to process queries use theDYNAMICrow format, regardless of theinnodb_default_row_formatsetting.In MySQL 5.7.8 and earlier, the default row format is
COMPACT. innodb_disable_sort_file_cacheCommand-Line Format --innodb_disable_sort_file_cache=#System Variable Name innodb_disable_sort_file_cacheVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFIf enabled, this variable disables the operating system file system cache for merge-sort temporary files. The effect is to open such files with the equivalent of
O_DIRECT.innodb_disable_resize_buffer_pool_debugIntroduced 5.7.6 Command-Line Format --innodb_disable_resize_buffer_pool_debug=#System Variable Name innodb_disable_resize_buffer_pool_debugVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default ONDisables resizing of the
InnoDBbuffer pool. This option is only available if debugging support is compiled in using theWITH_DEBUGCMake option.-
Command-Line Format --innodb-doublewriteSystem Variable Name innodb_doublewriteVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default ONIf this variable is enabled (the default),
InnoDBstores all data twice, first to the doublewrite buffer, then to the actual data files. This variable can be turned off with--skip-innodb_doublewritefor benchmarks or cases when top performance is needed rather than concern for data integrity or possible failures.As of MySQL 5.7.4, if system tablespace files (“ibdata files”) are located on Fusion-io devices that support atomic writes, doublewrite buffering is automatically disabled and Fusion-io atomic writes are used for all data files. Because the doublewrite buffer setting is global, doublewrite buffering is also disabled for data files residing on non-Fusion-io hardware. This feature is only supported on Fusion-io hardware and is only enabled for Fusion-io NVMFS on Linux. To take full advantage of this feature, an
innodb_flush_methodsetting ofO_DIRECTis recommended. -
Command-Line Format --innodb_fast_shutdown[=#]System Variable Name innodb_fast_shutdownVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 1Valid Values 012The
InnoDBshutdown mode. If the value is 0,InnoDBdoes a slow shutdown, a full purge and a change buffer merge before shutting down. If the value is 1 (the default),InnoDBskips these operations at shutdown, a process known as a fast shutdown. If the value is 2,InnoDBflushes its logs and shuts down cold, as if MySQL had crashed; no committed transactions are lost, but the crash recovery operation makes the next startup take longer.The slow shutdown can take minutes, or even hours in extreme cases where substantial amounts of data are still buffered. Use the slow shutdown technique before upgrading or downgrading between MySQL major releases, so that all data files are fully prepared in case the upgrade process updates the file format.
Use
innodb_fast_shutdown=2in emergency or troubleshooting situations, to get the absolute fastest shutdown if data is at risk of corruption. innodb_fil_make_page_dirty_debugCommand-Line Format --innodb_fil_make_page_dirty_debug=#System Variable Name innodb_fil_make_page_dirty_debugVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 0Max Value 2**32-1By default, setting
innodb_fil_make_page_dirty_debugto the ID of a tablespace immediately dirties the first page of the tablespace. Ifinnodb_saved_page_number_debugis set to a non-default value, settinginnodb_fil_make_page_dirty_debugdirties the specified page. Theinnodb_fil_make_page_dirty_debugoption is only available if debugging support is compiled in using theWITH_DEBUGCMake option.-
Deprecated 5.7.7 Command-Line Format --innodb_file_format=#System Variable Name innodb_file_formatVariable Scope Global Dynamic Variable Yes Permitted Values (<= 5.7.6) Type string Default AntelopeValid Values AntelopeBarracudaPermitted Values (>= 5.7.7) Type string Default BarracudaValid Values AntelopeBarracudaEnables an
InnoDBfile format for file-per-table tablespaces. Supported file formats areAntelopeandBarracuda.Antelopeis the originalInnoDBfile format, which supportsREDUNDANTandCOMPACTrow formats.Barracudais the newer file format, which supportsCOMPRESSEDandDYNAMICrow formats.COMPRESSEDandDYNAMICrow formats enable important storage features forInnoDBtables. See Section 15.11, “InnoDB Row Storage and Row Formats”.Changing the
innodb_file_formatsetting does not affect the file format of existingInnoDBtablespace files.The
innodb_file_formatsetting does not apply to general tablespaces, which support tables of all row formats. See Section 15.7.9, “InnoDB General Tablespaces”.The
innodb_file_formatdefault value was changed toBarracudain MySQL 5.7.7.As of MySQL 5.7.9, the
innodb_file_formatsetting is ignored when creating tables that use theDYNAMICrow format. A table created using theDYNAMICrow format always uses theBarracudafile format, regardless of theinnodb_file_formatsetting. To use theCOMPRESSEDrow format,innodb_file_formatmust be set toBarracuda.The
innodb_file_formatoption is deprecated in MySQL 5.7.7 and will be removed in a future release. The purpose of theinnodb_file_formatoption was to allow users to downgrade to the built-in version ofInnoDBin MySQL 5.1. Now that MySQL 5.1 has reached the end of its product lifecycle, downgrade support provided by this option is no longer necessary.For more information, see Section 15.10, “InnoDB File-Format Management”.
-
Deprecated 5.7.7 Command-Line Format --innodb_file_format_check=#System Variable Name innodb_file_format_checkVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default ONThis variable can be set to 1 or 0 at server startup to enable or disable whether
InnoDBchecks the file format tag in the system tablespace (for example,AntelopeorBarracuda). If the tag is checked and is higher than that supported by the current version ofInnoDB, an error occurs andInnoDBdoes not start. If the tag is not higher,InnoDBsets the value ofinnodb_file_format_maxto the file format tag.NoteDespite the default value sometimes being displayed as
ONorOFF, always use the numeric values 1 or 0 to turn this option on or off in your configuration file or command line.The
innodb_file_format_checkoption is deprecated in MySQL 5.7.7 together with theinnodb_file_formatoption. Both options will be removed in a future release. -
Deprecated 5.7.7 Command-Line Format --innodb_file_format_max=#System Variable Name innodb_file_format_maxVariable Scope Global Dynamic Variable Yes Permitted Values (<= 5.7.8) Type string Default AntelopeValid Values AntelopeBarracudaPermitted Values (>= 5.7.9) Type string Default BarracudaValid Values AntelopeBarracudaAt server startup,
InnoDBsets the value of this variable to the file format tag in the system tablespace (for example,AntelopeorBarracuda). If the server creates or opens a table with a “higher” file format, it sets the value ofinnodb_file_format_maxto that format.The
innodb_file_format_maxoption is deprecated in MySQL 5.7.7 together with theinnodb_file_formatoption. Both options will be removed in a future release. -
Command-Line Format --innodb_file_per_tableSystem Variable Name innodb_file_per_tableVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default ONWhen
innodb_file_per_tableis enabled (the default in 5.6.6 and higher),InnoDBstores the data and indexes for each newly created table in a separate.ibdfile, rather than in the system tablespace. The storage for theseInnoDBtables is reclaimed when the tables are dropped or truncated. This setting enables several otherInnoDBfeatures, such as table compression. See Section 15.7.4, “InnoDB File-Per-Table Tablespaces” for details about such features as well as advantages and disadvantages of using per-table tablespaces.Be aware that enabling
innodb_file_per_tablealso means that anALTER TABLEoperation will moveInnoDBtable from the system tablespace to an individual.ibdfile in cases whereALTER TABLErecreates the table (ALGORITHM=COPY). An exception to this rule is for tables that were placed in the system tablespace using theTABLESPACE=innodb_systemoption withCREATE TABLEorALTER TABLE. These tables are unaffected by theinnodb_file_per_tablesetting and can only be moved to file-per-table tablespaces usingALTER TABLE ... TABLESPACE=innodb_file_per_table.When
innodb_file_per_tableis disabled,InnoDBstores the data for all tables and indexes in the ibdata files that make up the system tablespace. This setting reduces the performance overhead of filesystem operations for operations such asDROP TABLEorTRUNCATE TABLE. It is most appropriate for a server environment where entire storage devices are devoted to MySQL data. Because the system tablespace never shrinks, and is shared across all databases in an instance, avoid loading huge amounts of temporary data on a space-constrained system wheninnodb_file_per_table=OFF. Set up a separate instance in such cases, so that you can drop the entire instance to reclaim the space.By default,
innodb_file_per_tableis enabled as of MySQL 5.6.6, disabled before that. Consider disabling it if backward compatibility with MySQL 5.5 or 5.1 is a concern. This will preventALTER TABLEfrom movingInnoDBtables from the system tablespace to individual.ibdfiles.innodb_file_per_tableis dynamic and can be setONorOFFusingSET GLOBAL. You can also set this parameter in the MySQL configuration file (my.cnformy.ini) but this requires shutting down and restarting the server.Dynamically changing the value of this parameter requires the
SUPERprivilege and immediately affects the operation of all connections. -
Introduced 5.7.5 Command-Line Format --innodb_fill_factor=#System Variable Name innodb_fill_factorVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 100Min Value 10Max Value 100As of MySQL 5.7.5,
InnoDBperforms a bulk load when creating or rebuilding indexes. This method of index creation is known as a “sorted index build”.innodb_fill_factordefines the percentage of space on each B-tree page that is filled during a sorted index build, with the remaining space reserved for future index growth. For example, settinginnodb_fill_factorto 80 reserves 20 percent of the space on each B-tree page for future index growth. Actual percentages may vary. Theinnodb_fill_factorsetting is interpreted as a hint rather than a hard limit.As of MySQL 5.7.8, an
innodb_fill_factorsetting of 100 leaves 1/16 of the space in clustered index pages free for future index growth (MySQL Bug #74325).innodb_fill_factorapplies to both B-tree leaf and non-leaf pages. It does not apply to external pages used forTEXTorBLOBentries.For more information, see Section 15.8.12, “Sorted Index Builds”.
-
System Variable Name innodb_flush_log_at_timeoutVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 1Min Value 1Max Value 2700Write and flush the logs every
Nseconds.innodb_flush_log_at_timeoutwas introduced in MySQL 5.6.6. It allows the timeout period between flushes to be increased in order to reduce flushing and avoid impacting performance of binary log group commit. Prior to MySQL 5.6.6, flushing frequency was once per second. The default setting forinnodb_flush_log_at_timeoutis also once per second. innodb_flush_log_at_trx_commitCommand-Line Format --innodb_flush_log_at_trx_commit[=#]System Variable Name innodb_flush_log_at_trx_commitVariable Scope Global Dynamic Variable Yes Permitted Values Type enumeration Default 1Valid Values 012Controls the balance between strict ACID compliance for commit operations, and higher performance that is possible when commit-related I/O operations are rearranged and done in batches. You can achieve better performance by changing the default value, but then you can lose up to a second of transactions in a crash.
The default value of 1 is required for full ACID compliance. With this value, the contents of the
InnoDBlog buffer are written out to the log file at each transaction commit and the log file is flushed to disk.With a value of 0, the contents of the
InnoDBlog buffer are written to the log file approximately once per second and the log file is flushed to disk. No writes from the log buffer to the log file are performed at transaction commit. Once-per-second flushing is not 100% guaranteed to happen every second, due to process scheduling issues. Because the flush to disk operation only occurs approximately once per second, you can lose up to a second of transactions with any mysqld process crash.With a value of 2, the contents of the
InnoDBlog buffer are written to the log file after each transaction commit and the log file is flushed to disk approximately once per second. Once-per-second flushing is not 100% guaranteed to happen every second, due to process scheduling issues. Because the flush to disk operation only occurs approximately once per second, you can lose up to a second of transactions in an operating system crash or a power outage.As of MySQL 5.6.6,
InnoDBlog flushing frequency is controlled byinnodb_flush_log_at_timeout, which allows you to set log flushing frequency toNseconds (whereNis1 ... 2700, with a default value of 1). However, any mysqld process crash can erase up toNseconds of transactions.DDL changes and other internal
InnoDBactivities flush theInnoDBlog independent of theinnodb_flush_log_at_trx_commitsetting.InnoDB's crash recovery works regardless of theinnodb_flush_log_at_trx_commitsetting. Transactions are either applied entirely or erased entirely.
For durability and consistency in a replication setup that uses
InnoDBwith transactions:If binary logging is enabled, set
sync_binlog=1.Always set
innodb_flush_log_at_trx_commit=1.
CautionMany operating systems and some disk hardware fool the flush-to-disk operation. They may tell mysqld that the flush has taken place, even though it has not. Then the durability of transactions is not guaranteed even with the setting 1, and in the worst case a power outage can even corrupt
InnoDBdata. Using a battery-backed disk cache in the SCSI disk controller or in the disk itself speeds up file flushes, and makes the operation safer. You can also try using the Unix command hdparm to disable the caching of disk writes in hardware caches, or use some other command specific to the hardware vendor.-
Command-Line Format --innodb_flush_method=nameSystem Variable Name innodb_flush_methodVariable Scope Global Dynamic Variable No Permitted Values (Unix) Type string Default NULLValid Values fsyncO_DSYNClittlesyncnosyncO_DIRECTO_DIRECT_NO_FSYNCPermitted Values (Windows) Type string Default NULLValid Values async_unbufferednormalunbufferedDefines the method used to flush data to the
InnoDBdata files and log files, which can affect I/O throughput.If
innodb_flush_method=NULLon a Unix-like system, thefsyncoption is used by default. Ifinnodb_flush_method=NULLon Windows, theasync_unbufferedoption is used by default.The
innodb_flush_methodoptions for Unix-like systems include:fsync:InnoDBuses thefsync()system call to flush both the data and log files.fsyncis the default setting.O_DSYNC:InnoDBusesO_SYNCto open and flush the log files, andfsync()to flush the data files.InnoDBdoes not useO_DSYNCdirectly because there have been problems with it on many varieties of Unix.littlesync: This option is used for internal performance testing and is currently unsupported. Use at your own risk.nosync: This option is used for internal performance testing and is currently unsupported. Use at your own risk.O_DIRECT:InnoDBusesO_DIRECT(ordirectio()on Solaris) to open the data files, and usesfsync()to flush both the data and log files. This option is available on some GNU/Linux versions, FreeBSD, and Solaris.O_DIRECT_NO_FSYNC:InnoDBusesO_DIRECTduring flushing I/O, but skips thefsync()system call afterward. This setting is suitable for some types of file systems but not others. For example, it is not suitable for XFS. If you are not sure whether the file system you use requires anfsync(), for example to preserve all file metadata, useO_DIRECTinstead. This option was introduced in MySQL 5.6.7 (Bug #11754304, Bug #45892).
The
innodb_flush_methodoptions for Windows systems include:async_unbuffered:InnoDBuses Windows asynchronous I/O and non-buffered I/O.async_unbufferedis the default setting on Windows systems.normal:InnoDBuses a simulated asynchronous I/O and buffered I/O.unbuffered:InnoDBuses a simulated asynchronous I/O and non-buffered I/O.
How each settings affects performance depends on hardware configuration and workload. Benchmark your particular configuration to decide which setting to use, or whether to keep the default setting. Examine the
Innodb_data_fsyncsstatus variable to see the overall number offsync()calls for each setting. The mix of read and write operations in your workload can affect how a setting performs. For example, on a system with a hardware RAID controller and battery-backed write cache,O_DIRECTcan help to avoid double buffering between theInnoDBbuffer pool and the operating system's file system cache. On some systems whereInnoDBdata and log files are located on a SAN, the default value orO_DSYNCmight be faster for a read-heavy workload with mostlySELECTstatements. Always test this parameter with hardware and workload that reflect your production environment. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”. -
Command-Line Format --innodb_flush_neighborsSystem Variable Name innodb_flush_neighborsVariable Scope Global Dynamic Variable Yes Permitted Values Type enumeration Default 1Valid Values 012Specifies whether flushing a page from the InnoDB buffer pool also flushes other dirty pages in the same extent.
The default value of 1 flushes contiguous dirty pages in the same extent from the buffer pool.
A setting of 0 turns
innodb_flush_neighborsoff and no other dirty pages are flushed from the buffer pool.A setting of 2 flushes dirty pages in the same extent from the buffer pool.
When the table data is stored on a traditional HDD storage device, flushing such neighbor pages in one operation reduces I/O overhead (primarily for disk seek operations) compared to flushing individual pages at different times. For table data stored on SSD, seek time is not a significant factor and you can turn this setting off to spread out the write operations. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.
-
Introduced 5.7.8 Command-Line Format --innodb_flush_sync=#System Variable Name innodb_flush_syncVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default ONThe
innodb_flush_syncparameter, which is enabled by default, causes theinnodb_io_capacitysetting to be ignored for bursts of I/O activity that occur at checkpoints. To adhere to the limit onInnoDBbackground I/O activity defined by theinnodb_io_capacitysetting, disableinnodb_flush_sync. -
Command-Line Format --innodb_flushing_avg_loops=#System Variable Name innodb_flushing_avg_loopsVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 30Min Value 1Max Value 1000Number of iterations for which InnoDB keeps the previously calculated snapshot of the flushing state, controlling how quickly adaptive flushing responds to changing workloads. Increasing the value makes the rate of flush operations change smoothly and gradually as the workload changes. Decreasing the value makes adaptive flushing adjust quickly to workload changes, which can cause spikes in flushing activity if the workload increases and decreases suddenly.
-
Command-Line Format --innodb_force_load_corruptedSystem Variable Name innodb_force_load_corruptedVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default OFFLets InnoDB load tables at startup that are marked as corrupted. Use only during troubleshooting, to recover data that is otherwise inaccessible. When troubleshooting is complete, turn this setting back off and restart the server.
-
Command-Line Format --innodb_force_recovery=#System Variable Name innodb_force_recoveryVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 0Min Value 0Max Value 6The crash recovery mode, typically only changed in serious troubleshooting situations. Possible values are from 0 to 6. For the meanings of these values and important information about
innodb_force_recovery, see Section 15.21.2, “Forcing InnoDB Recovery”.WarningOnly set this variable to a value greater than 0 in an emergency situation, so that you can start
InnoDBand dump your tables. As a safety measure,InnoDBpreventsINSERT,UPDATE, orDELETEoperations wheninnodb_force_recoveryis greater than 0. Also, as of 5.7.3, aninnodb_force_recoverysetting of 4 or greater placesInnoDBinto read-only mode.These restrictions may cause replication administration commands to fail with an error, as replication options such as
--relay-log-info-repository=TABLEand--master-info-repository=TABLEstore information in tables inInnoDB. -
Command-Line Format --innodb_ft_aux_table=#(>= 5.7.2)System Variable Name innodb_ft_aux_tableVariable Scope Global Dynamic Variable Yes Permitted Values Type string Specifies the qualified name of an
InnoDBtable containing aFULLTEXTindex. This variable is intended for diagnostic purposes.After you set this variable to a name in the format
, thedb_name/table_nameINFORMATION_SCHEMAtablesINNODB_FT_INDEX_TABLE,INNODB_FT_INDEX_CACHE,INNODB_FT_CONFIG,INNODB_FT_DELETED, andINNODB_FT_BEING_DELETEDwill show information about the search index for the specified table. -
Command-Line Format --innodb_ft_cache_size=#System Variable Name innodb_ft_cache_sizeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 8000000Min Value 1600000Max Value 80000000The memory allocated, in bytes, for the
InnoDBFULLTEXTsearch index cache, which holds a parsed document in memory while creating anInnoDBFULLTEXTindex. Index inserts and updates are only committed to disk when theinnodb_ft_cache_sizesize limit is reached.innodb_ft_cache_sizedefines the cache size on a per table basis. To set a global limit for all tables, seeinnodb_ft_total_cache_size. -
Command-Line Format --innodb_ft_enable_diag_print=#System Variable Name innodb_ft_enable_diag_printVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFWhether to enable additional full-text search (FTS) diagnostic output. This option is primarily intended for advanced FTS debugging and will not be of interest to most users. Output is printed to the error log and includes information such as:
FTS index sync progress (when the FTS cache limit is reached). For example:
FTS SYNC for table test, deleted count: 100 size: 10000 bytes SYNC words: 100
FTS optimize progress. For example:
FTS start optimize test FTS_OPTIMIZE: optimize "mysql" FTS_OPTIMIZE: processed "mysql"
FTS index build progress. For example:
Number of doc processed: 1000
For FTS queries, the query parsing tree, word weight, query processing time, and memory usage are printed. For example:
FTS Search Processing time: 1 secs: 100 millisec: row(s) 10000 Full Search Memory: 245666 (bytes), Row: 10000
-
Command-Line Format --innodb_ft_enable_stopword=#System Variable Name innodb_ft_enable_stopwordVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default ONSpecifies that a set of stopwords is associated with an
InnoDBFULLTEXTindex at the time the index is created. If theinnodb_ft_user_stopword_tableoption is set, the stopwords are taken from that table. Else, if theinnodb_ft_server_stopword_tableoption is set, the stopwords are taken from that table. Otherwise, a built-in set of default stopwords is used. -
Command-Line Format --innodb_ft_max_token_size=#System Variable Name innodb_ft_max_token_sizeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 84Min Value 10Max Value 84Permitted Values (<= 5.7.2) Type integer Default 84Min Value 10Max Value 252Permitted Values (>= 5.7.3) Type integer Default 84Min Value 10Max Value 84Maximum character length of words that are stored in an InnoDB
FULLTEXTindex. Setting a limit on this value reduces the size of the index, thus speeding up queries, by omitting long keywords or arbitrary collections of letters that are not real words and are not likely to be search terms. -
Command-Line Format --innodb_ft_min_token_size=#System Variable Name innodb_ft_min_token_sizeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 3Min Value 0Max Value 16Minimum length of words that are stored in an InnoDB
FULLTEXTindex. Increasing this value reduces the size of the index, thus speeding up queries, by omitting common word that are unlikely to be significant in a search context, such as the English words “a” and “to”. For content using a CJK (Chinese, Japanese, Korean) character set, specify a value of 1. -
Command-Line Format --innodb_ft_num_word_optimize=#System Variable Name innodb_ft_num_word_optimizeVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 2000Number of words to process during each
OPTIMIZE TABLEoperation on anInnoDBFULLTEXTindex. Because a bulk insert or update operation to a table containing a full-text search index could require substantial index maintenance to incorporate all changes, you might do a series ofOPTIMIZE TABLEstatements, each picking up where the last left off. -
Introduced 5.7.2 Command-Line Format --innodb_ft_result_cache_limit=#System Variable Name innodb_ft_result_cache_limitVariable Scope Global Dynamic Variable Yes Permitted Values (>= 5.7.4) Type integer Default 2000000000Min Value 1000000Max Value 2**32-1Permitted Values (Unix, 32-bit platforms, >= 5.7.2, <= 5.7.3) Type integer Default 2000000000Min Value 1000000Max Value 2**32-1Permitted Values (Unix, 64-bit platforms, >= 5.7.2, <= 5.7.3) Type integer Default 2000000000Min Value 1000000Max Value 2**64-1Permitted Values (Windows, >= 5.7.2, <= 5.7.3) Type integer Default 2000000000Min Value 1000000Max Value 2**32-1The
InnoDBFULLTEXT search (FTS) query result cache limit (defined in bytes) per FTS query or per thread. Intermediate and finalInnoDBFTS query results are handled in memory. Useinnodb_ft_result_cache_limitto place a size limit on theInnoDBFTS query result cache to avoid excessive memory consumption in case of very largeInnoDBFTS query results (millions or hundreds of millions of rows, for example). Memory is allocated as required when an FTS query is processed. If the result cache size limit is reached, an error is returned indicating that the query exceeds the maximum allowed memory.As of MySQL 5.7.4, the maximum value of
innodb_ft_result_cache_limitfor all platform types and platform bit sizes is 2**32-1. Bug #71554. innodb_ft_server_stopword_tableCommand-Line Format --innodb_ft_server_stopword_table=db_name/table_nameSystem Variable Name innodb_ft_server_stopword_tableVariable Scope Global Dynamic Variable Yes Permitted Values Type string Default NULLThis option is used to specify your own
InnoDBFULLTEXTindex stopword list for allInnoDBtables. To configure your own stopword list for a specificInnoDBtable, useinnodb_ft_user_stopword_table.Set
innodb_ft_server_stopword_tableto the name of the table containing a list of stopwords, in the format.db_name/table_nameThe stopword table must exist before you configure
innodb_ft_server_stopword_table.innodb_ft_enable_stopwordmust be enabled andinnodb_ft_server_stopword_tableoption must be configured before you create theFULLTEXTindex.The stopword table must be an
InnoDBtable, containing a singleVARCHARcolumn namedvalue.For more information, see Section 13.9.4, “Full-Text Stopwords”.
-
Command-Line Format --innodb_ft_sort_pll_degree=#System Variable Name innodb_ft_sort_pll_degreeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 2Min Value 1Max Value 32Number of threads used in parallel to index and tokenize text in an
InnoDBFULLTEXTindex, when building a search index. Seeinnodb_sort_buffer_sizefor additional usage information. -
Introduced 5.7.2 Command-Line Format --innodb_ft_total_cache_size=#System Variable Name innodb_ft_total_cache_sizeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 640000000Min Value 32000000Max Value 1600000000The total memory allocated, in bytes, for the
InnoDBFULLTEXT search index cache for all tables. Creating numerous tables, each with a full-text search index, could consume a significant portion of available memory.innodb_ft_total_cache_size, defines a global memory limit for all full-text search indexes to help avoid excessive memory consumption. If the global limit is reached by an index operation, a force sync is triggered. -
Command-Line Format --innodb_ft_user_stopword_table=db_name/table_nameSystem Variable Name innodb_ft_user_stopword_tableVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type string Default NULLThis option is used to specify your own
InnoDBFULLTEXTindex stopword list on a specific table. To configure your own stopword list for allInnoDBtables, useinnodb_ft_server_stopword_table.Set
innodb_ft_user_stopword_tableto the name of the table containing a list of stopwords, in the format.db_name/table_nameThe stopword table must exist before you configure
innodb_ft_user_stopword_table.innodb_ft_enable_stopwordmust be enabled andinnodb_ft_user_stopword_tablemust be configured before you create theFULLTEXTindex.The stopword table must be an
InnoDBtable, containing a singleVARCHARcolumn namedvalue.For more information, see Section 13.9.4, “Full-Text Stopwords”.
-
Command-Line Format --innodb_io_capacity=#System Variable Name innodb_io_capacityVariable Scope Global Dynamic Variable Yes Permitted Values (32-bit platforms) Type integer Default 200Min Value 100Max Value 2**32-1Permitted Values (64-bit platforms) Type integer Default 200Min Value 100Max Value 2**64-1The
innodb_io_capacityparameter sets an upper limit on I/O activity performed byInnoDBbackground tasks, such as flushing pages from the buffer pool and merging data from the change buffer.The
innodb_io_capacitylimit is a total limit for all buffer pool instances. When dirty pages are flushed, the limit is divided equally among buffer pool instances.innodb_io_capacityshould be set to approximately the number of I/O operations that the system can perform per second. Ideally, keep the setting as low as practical, but not so low that background activities fall behind. If the value is too high, data is removed from the buffer pool and insert buffer too quickly for caching to provide a significant benefit.The default value is 200. For busy systems capable of higher I/O rates, you can set a higher value to help the server handle the background maintenance work associated with a high rate of row changes.
In general, you can increase the value as a function of the number of drives used for
InnoDBI/O. For example, you can increase the value on systems that use multiple disks or solid-state disks (SSD).The default setting of 200 is generally sufficient for a lower-end SSD. For a higher-end, bus-attached SSD, consider a higher setting such as 1000, for example. For systems with individual 5400 RPM or 7200 RPM drives, you might lower the value to
100, which represents an estimated proportion of the I/O operations per second (IOPS) available to older-generation disk drives that could perform about 100 IOPS.Although you can specify a very high value such as one million, in practice such large values have little if any benefit. Generally, a value of 20000 or higher is not recommended unless you have proven that lower values are insufficient for your workload.
Consider write workload when tuning
innodb_io_capacity. Systems with large write workloads are likely to benefit from a higher setting. A lower setting may be sufficient for systems with a small write workload.You can set
innodb_io_capacityto any number 100 or greater to a maximum defined byinnodb_io_capacity_max.innodb_io_capacitycan be set in the MySQL option file (my.cnformy.ini) or changed dynamically using aSET GLOBALstatement, which requires theSUPERprivilege.The
innodb_flush_syncconfiguration option, introduced in MySQL 5.7.8, causes theinnodb_io_capacitysetting to be ignored during bursts of I/O activity that occur at checkpoints.innodb_flush_syncis enabled by default.See Section 15.6.8, “Configuring the InnoDB Master Thread I/O Rate” for more guidelines about this option. For general information about
InnoDBI/O performance, see Section 9.5.8, “Optimizing InnoDB Disk I/O”. -
Command-Line Format --innodb_io_capacity_max=#System Variable Name innodb_io_capacity_maxVariable Scope Global Dynamic Variable Yes Permitted Values (32-bit platforms) Type integer Default see descriptionMin Value 100Max Value 2**32-1Permitted Values (Unix, 64-bit platforms) Type integer Default see descriptionMin Value 100Max Value 2**64-1Permitted Values (Windows, 64-bit platforms) Type integer Default see descriptionMin Value 100Max Value 2**32-1If flushing activity falls behind,
InnoDBcan flush more aggressively than the limit imposed byinnodb_io_capacity.innodb_io_capacity_maxdefines an upper limit for I/O capacity in such situations.The
innodb_io_capacity_maxsetting is a total limit for all buffer pool instances.If you specify an
innodb_io_capacitysetting at startup but do not specify a value forinnodb_io_capacity_max,innodb_io_capacity_maxdefaults to twice the value ofinnodb_io_capacity, with a minimum value of 2000.When configuring
innodb_io_capacity_max, twice theinnodb_io_capacityis often a good starting point. The default value of 2000 is intended for workloads that use a solid-state disk (SSD) or more than one regular disk drive. A setting of 2000 is likely too high for workloads that do not use SSD or multiple disk drives, and could allow too much flushing. For a single regular disk drive, a setting between 200 and 400 is recommended. For a high-end, bus-attached SSD, consider a higher setting such as 2500. As with theinnodb_io_capacitysetting, keep the setting as low as practical, but not so low thatInnoDBcannot sufficiently extend beyond theinnodb_io_capacitylimit if necessary.Consider write workload when tuning
innodb_io_capacity_max. Systems with large write workloads may benefit from a higher setting. A lower setting may be sufficient for systems with a small write workload.innodb_io_capacity_maxcannot be set to a value lower than theinnodb_io_capacityvalue.Setting
innodb_io_capacity_maxtoDEFAULTusing aSETstatement (SET GLOBAL innodb_io_capacity_max=DEFAULT) setsinnodb_io_capacity_maxto the maximum value.For a brief period during MySQL 5.6 development, this variable was known as
innodb_max_io_capacity.For related information, see Section 15.6.3.7, “Fine-tuning InnoDB Buffer Pool Flushing”.
-
Deprecated 5.7.7 Command-Line Format --innodb_large_prefixSystem Variable Name innodb_large_prefixVariable Scope Global Dynamic Variable Yes Permitted Values (<= 5.7.6) Type boolean Default OFFPermitted Values (>= 5.7.7) Type boolean Default ONWhen this option is enabled, index key prefixes longer than 767 bytes (up to 3072 bytes) are allowed for
InnoDBtables that use theDYNAMICandCOMPRESSEDrow formats. See Section 15.8.8, “Limits on InnoDB Tables” for the relevant maximums associated with index key prefixes under various settings.For tables that use the
REDUNDANTandCOMPACTrow formats, this option does not affect the permitted index key prefix length.innodb_large_prefixis enabled by default in MySQL 5.7.7. This change coincides with the default value change forinnodb_file_format, which is set toBarracudaby default in MySQL 5.7.7. Together, these default value changes allow larger index key prefixes to be created when usingROW_FORMAT=DYNAMICorROW_FORMAT=COMPRESSED. If either option is set to a non-default value, index key prefixes larger than 767 bytes are silently truncated.innodb_large_prefixis deprecated in MySQL 5.7.7 and will be removed in a future release.innodb_large_prefixwas introduced in MySQL 5.5 to disable large index key prefixes for compatibility with earlier versions ofInnoDBthat do not support large index key prefixes. innodb_limit_optimistic_insert_debugCommand-Line Format --innodb_limit_optimistic_insert_debug=#System Variable Name innodb_limit_optimistic_insert_debugVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 0Min Value 0Max Value 2**32-1Limits the number of records per B-tree page. A default value of 0 means that no limit is imposed. This option is only available if debugging support is compiled in using the
WITH_DEBUGCMake option.-
Command-Line Format --innodb_lock_wait_timeout=#System Variable Name innodb_lock_wait_timeoutVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type integer Default 50Min Value 1Max Value 1073741824The length of time in seconds an
InnoDBtransaction waits for a row lock before giving up. The default value is 50 seconds. A transaction that tries to access a row that is locked by anotherInnoDBtransaction waits at most this many seconds for write access to the row before issuing the following error:ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
When a lock wait timeout occurs, the current statement is rolled back (not the entire transaction). To have the entire transaction roll back, start the server with the
--innodb_rollback_on_timeoutoption. See also Section 15.21.4, “InnoDB Error Handling”.You might decrease this value for highly interactive applications or OLTP systems, to display user feedback quickly or put the update into a queue for processing later. You might increase this value for long-running back-end operations, such as a transform step in a data warehouse that waits for other large insert or update operations to finish.
innodb_lock_wait_timeoutapplies toInnoDBrow locks only. A MySQL table lock does not happen insideInnoDBand this timeout does not apply to waits for table locks.The lock wait timeout value does not apply to deadlocks when
innodb_deadlock_detectis enabled (the default) becauseInnoDBdetects deadlocks immediately and rolls back one of the deadlocked transactions. Wheninnodb_deadlock_detectis disabled,InnoDBrelies oninnodb_lock_wait_timeoutfor transaction rollback when a deadlock occurs.innodb_lock_wait_timeoutcan be set at runtime with theSET GLOBALorSET SESSIONstatement. Changing theGLOBALsetting requires theSUPERprivilege and affects the operation of all clients that subsequently connect. Any client can change theSESSIONsetting forinnodb_lock_wait_timeout, which affects only that client. innodb_locks_unsafe_for_binlogDeprecated 5.6.3 Command-Line Format --innodb_locks_unsafe_for_binlogSystem Variable Name innodb_locks_unsafe_for_binlogVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default OFFThis variable affects how
InnoDBuses gap locking for searches and index scans. As of MySQL 5.6.3,innodb_locks_unsafe_for_binlogis deprecated and will be removed in a future MySQL release.Normally,
InnoDBuses an algorithm called next-key locking that combines index-row locking with gap locking.InnoDBperforms row-level locking in such a way that when it searches or scans a table index, it sets shared or exclusive locks on the index records it encounters. Thus, the row-level locks are actually index-record locks. In addition, a next-key lock on an index record also affects the “gap” before that index record. That is, a next-key lock is an index-record lock plus a gap lock on the gap preceding the index record. If one session has a shared or exclusive lock on recordRin an index, another session cannot insert a new index record in the gap immediately beforeRin the index order. See Section 15.5.1, “InnoDB Locking”.By default, the value of
innodb_locks_unsafe_for_binlogis 0 (disabled), which means that gap locking is enabled:InnoDBuses next-key locks for searches and index scans. To enable the variable, set it to 1. This causes gap locking to be disabled:InnoDBuses only index-record locks for searches and index scans.Enabling
innodb_locks_unsafe_for_binlogdoes not disable the use of gap locking for foreign-key constraint checking or duplicate-key checking.The effects of enabling
innodb_locks_unsafe_for_binlogare the same as setting the transaction isolation level toREAD COMMITTED, with these exceptions:Enabling
innodb_locks_unsafe_for_binlogis a global setting and affects all sessions, whereas the isolation level can be set globally for all sessions, or individually per session.innodb_locks_unsafe_for_binlogcan be set only at server startup, whereas the isolation level can be set at startup or changed at runtime.
READ COMMITTEDtherefore offers finer and more flexible control thaninnodb_locks_unsafe_for_binlog. For additional details about the effect of isolation level on gap locking, see Section 15.5.2.1, “Transaction Isolation Levels”.Enabling
innodb_locks_unsafe_for_binlogmay cause phantom problems because other sessions can insert new rows into the gaps when gap locking is disabled. Suppose that there is an index on theidcolumn of thechildtable and that you want to read and lock all rows from the table having an identifier value larger than 100, with the intention of updating some column in the selected rows later:SELECT * FROM child WHERE id > 100 FOR UPDATE;
The query scans the index starting from the first record where
idis greater than 100. If the locks set on the index records in that range do not lock out inserts made in the gaps, another session can insert a new row into the table. Consequently, if you were to execute the sameSELECTagain within the same transaction, you would see a new row in the result set returned by the query. This also means that if new items are added to the database,InnoDBdoes not guarantee serializability. Therefore, ifinnodb_locks_unsafe_for_binlogis enabled,InnoDBguarantees at most an isolation level ofREAD COMMITTED. (Conflict serializability is still guaranteed.) For additional information about phantoms, see Section 15.5.4, “Phantom Rows”.Enabling
innodb_locks_unsafe_for_binloghas additional effects:For
UPDATEorDELETEstatements,InnoDBholds locks only for rows that it updates or deletes. Record locks for nonmatching rows are released after MySQL has evaluated theWHEREcondition. This greatly reduces the probability of deadlocks, but they can still happen.For
UPDATEstatements, if a row is already locked,InnoDBperforms a “semi-consistent” read, returning the latest committed version to MySQL so that MySQL can determine whether the row matches theWHEREcondition of theUPDATE. If the row matches (must be updated), MySQL reads the row again and this timeInnoDBeither locks it or waits for a lock on it.
Consider the following example, beginning with this table:
CREATE TABLE t (a INT NOT NULL, b INT) ENGINE = InnoDB; INSERT INTO t VALUES (1,2),(2,3),(3,2),(4,3),(5,2); COMMIT;
In this case, table has no indexes, so searches and index scans use the hidden clustered index for record locking (see Section 15.8.9, “Clustered and Secondary Indexes”).
Suppose that one client performs an
UPDATEusing these statements:SET autocommit = 0; UPDATE t SET b = 5 WHERE b = 3;
Suppose also that a second client performs an
UPDATEby executing these statements following those of the first client:SET autocommit = 0; UPDATE t SET b = 4 WHERE b = 2;
As
InnoDBexecutes eachUPDATE, it first acquires an exclusive lock for each row, and then determines whether to modify it. IfInnoDBdoes not modify the row andinnodb_locks_unsafe_for_binlogis enabled, it releases the lock. Otherwise,InnoDBretains the lock until the end of the transaction. This affects transaction processing as follows.If
innodb_locks_unsafe_for_binlogis disabled, the firstUPDATEacquires x-locks and does not release any of them:x-lock(1,2); retain x-lock x-lock(2,3); update(2,3) to (2,5); retain x-lock x-lock(3,2); retain x-lock x-lock(4,3); update(4,3) to (4,5); retain x-lock x-lock(5,2); retain x-lock
The second
UPDATEblocks as soon as it tries to acquire any locks (because first update has retained locks on all rows), and does not proceed until the firstUPDATEcommits or rolls back:x-lock(1,2); block and wait for first UPDATE to commit or roll back
If
innodb_locks_unsafe_for_binlogis enabled, the firstUPDATEacquires x-locks and releases those for rows that it does not modify:x-lock(1,2); unlock(1,2) x-lock(2,3); update(2,3) to (2,5); retain x-lock x-lock(3,2); unlock(3,2) x-lock(4,3); update(4,3) to (4,5); retain x-lock x-lock(5,2); unlock(5,2)
For the second
UPDATE,InnoDBdoes a “semi-consistent” read, returning the latest committed version of each row to MySQL so that MySQL can determine whether the row matches theWHEREcondition of theUPDATE:x-lock(1,2); update(1,2) to (1,4); retain x-lock x-lock(2,3); unlock(2,3) x-lock(3,2); update(3,2) to (3,4); retain x-lock x-lock(4,3); unlock(4,3) x-lock(5,2); update(5,2) to (5,4); retain x-lock
-
Command-Line Format --innodb_log_buffer_size=#System Variable Name innodb_log_buffer_sizeVariable Scope Global Dynamic Variable No Permitted Values (<= 5.7.5) Type integer Default 8388608Min Value 262144Max Value 4294967295Permitted Values (>= 5.7.6) Type integer Default 16777216Min Value 1048576Max Value 4294967295The size in bytes of the buffer that
InnoDBuses to write to the log files on disk. The default value changed from 8MB to 16MB in 5.7.6 with the introduction of 32k and 64kinnodb_page_sizevalues. A large log buffer enables large transactions to run without a need to write the log to disk before the transactions commit. Thus, if you have transactions that update, insert, or delete many rows, making the log buffer larger saves disk I/O. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”. -
Introduced 5.7.8 Removed 5.7.9 Command-Line Format --innodb_log_checksum_algorithm=#System Variable Name innodb_log_checksum_algorithmVariable Scope Global Dynamic Variable Yes Permitted Values (>= 5.7.8) Type enumeration Default innodbValid Values innodbcrc32nonestrict_innodbstrict_crc32strict_noneThis configuration option was removed in MySQL 5.7.9 and replaced by
innodb_log_checksums.Specifies how to generate and verify the checksum stored in each redo log disk block.
innodb_log_checksum_algorithmsupports same algorithms asinnodb_checksum_algorithm. Previously, only theinnodbalgorithm was supported for redo log disk blocks.innodb_log_checksum_algorithm=innodbis the default setting.The
strict_*forms work the same asinnodb,crc32, andnone, except thatInnoDBhalts if it encounters a mix of checksum values in the same redo log. You can only use these options in a completely new instance. Thestrict_*settings are somewhat faster, because they do not need to compute both new and old checksum values to accept both during disk reads.The following table illustrates the difference between the
none,innodb, andcrc32option values, and theirstrict_counterparts.none,innodb, andcrc32write the specified type checksum value into each data block, but for compatibility accept any of the other checksum values when verifying a block during a read operation. Thestrict_form of each parameter only recognizes one kind of checksum, which makes verification faster but requires that allInnoDBredo logs in an instance be created under the identicalinnodb_log_checksum_algorithmvalue.Table 15.14 Allowed Settings for innodb_log_checksum_algorithm
Value Generated checksum (when writing) Allowed checksums (when reading) none A constant number. Any of the checksums generated by none,innodb, orcrc32.innodb A checksum calculated in software, using the original algorithm from InnoDB.Any of the checksums generated by none,innodb, orcrc32.crc32 A checksum calculated using the crc32algorithm, possibly done with a hardware assist.Any of the checksums generated by none,innodb, orcrc32.strict_none A constant number Only the checksum generated by none.strict_innodb A checksum calculated in software, using the original algorithm from InnoDB.Only the checksum generated by innodb.strict_crc32 A checksum calculated using the crc32algorithm, possibly done with a hardware assist.Only the checksum generated by crc32. -
Introduced 5.7.9 Command-Line Format --innodb_log_checksums=#System Variable Name innodb_log_checksumsVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default ONEnables or disables checksums for redo log pages.
innodb_log_checksumsreplacesinnodb_log_checksum_algorithm, which was removed in MySQL 5.7.9.innodb_log_checksums=ONenables theCRC-32Cchecksum algorithm for redo log pages. Wheninnodb_log_checksumsis disabled, the contents of the redo log page checksum field are ignored.Checksums on the redo log header page and redo log checkpoint pages are never disabled.
-
Command-Line Format --innodb_log_compressed_pages=#System Variable Name innodb_log_compressed_pagesVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default ONSpecifies whether images of re-compressed pages are written to the redo log. Re-compression may occur when changes are made to compressed data.
innodb_log_compressed_pagesis enabled by default to prevent corruption that could occur if a different version of thezlibcompression algorithm is used during recovery. If you are certain that thezlibversion will not change, you can disableinnodb_log_compressed_pagesto reduce redo log generation for workloads that modify compressed data.To measure the effect of enabling or disabling
innodb_log_compressed_pages, compare redo log generation for both settings under the same workload. Options for measuring redo log generation include observing theLog sequence number(LSN) in theLOGsection ofSHOW ENGINE INNODB STATUSoutput, or monitoringInnodb_os_log_writtenstatus for the number of bytes written to the redo log files. -
Command-Line Format --innodb_log_file_size=#System Variable Name innodb_log_file_sizeVariable Scope Global Dynamic Variable No Permitted Values (<= 5.7.10) Type integer Default 50331648Min Value 1048576Max Value 512GB / innodb_log_files_in_groupPermitted Values (>= 5.7.11) Type integer Default 50331648Min Value 4194304Max Value 512GB / innodb_log_files_in_groupThe size in bytes of each log file in a log group. The combined size of log files (
innodb_log_file_size*innodb_log_files_in_group) cannot exceed a maximum value that is slightly less than 512GB. A pair of 255 GB log files, for example, would allow you to approach the limit but not exceed it. The default value is 48MB.Generally, the combined size of the log files should be large enough that the server can smooth out peaks and troughs in workload activity, which often means that there is enough redo log space to handle more than an hour of write activity. The larger the value, the less checkpoint flush activity is needed in the buffer pool, saving disk I/O. Larger log files also make crash recovery slower, although improvements to recovery performance in MySQL 5.5 and higher make the log file size less of a consideration. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.
The minimum
innodb_log_file_sizevalue was increased from 1MB to 4MB in MySQL 5.7.11. -
Command-Line Format --innodb_log_files_in_group=#System Variable Name innodb_log_files_in_groupVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 2Min Value 2Max Value 100The number of log files in the log group.
InnoDBwrites to the files in a circular fashion. The default (and recommended) value is 2. The location of these files is specified byinnodb_log_group_home_dir. The combined size of log files (innodb_log_file_size*innodb_log_files_in_group) can be up to 512GB. -
Command-Line Format --innodb_log_group_home_dir=dir_nameSystem Variable Name innodb_log_group_home_dirVariable Scope Global Dynamic Variable No Permitted Values Type directory name The directory path to the
InnoDBredo log files, whose number is specified byinnodb_log_files_in_group. If you do not specify anyInnoDBlog variables, the default is to create two files namedib_logfile0andib_logfile1in the MySQL data directory. Their size is given by the size of theinnodb_log_file_sizesystem variable. -
Introduced 5.7.4 Command-Line Format --innodb_log_write_ahead_size=#System Variable Name innodb_log_write_ahead_sizeVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 8192Min Value 512 (log file block size)Max Value Equal to innodb_page_sizeThe write-ahead block size for the redo log, in bytes. To avoid “read-on-write”, set
innodb_log_write_ahead_sizeto match the operating system or file system cache block size. Read-on-write occurs when redo log blocks are not entirely cached to the operating system or file system due to a mismatch between write-ahead block size for redo logs and operating system or file system cache block size.Valid values for
innodb_log_write_ahead_sizeare multiples of theInnoDBlog file block size (2^n). The minimum value is theInnoDBlog file block size (512). Write-ahead does not occur when the minimum value is specified. The maximum value is equal toinnodb_page_size. If you specify a value forinnodb_log_write_ahead_sizethat is larger than theinnodb_page_sizevalue, theinnodb_log_write_ahead_sizevalue is truncated to theinnodb_page_sizevalue.Setting the
innodb_log_write_ahead_sizevalue too low in relation to the operating system or file system cache block size will result in “read-on-write”. Setting the value too high may have a slight impact onfsyncperformance for log file writes due to several blocks being written at once. -
Command-Line Format --innodb_lru_scan_depth=#System Variable Name innodb_lru_scan_depthVariable Scope Global Dynamic Variable Yes Permitted Values (32-bit platforms) Type integer Default 1024Min Value 100Max Value 2**32-1Permitted Values (64-bit platforms) Type integer Default 1024Min Value 100Max Value 2**64-1A parameter that influences the algorithms and heuristics for the flush operation for the
InnoDBbuffer pool. Primarily of interest to performance experts tuning I/O-intensive workloads. It specifies, per buffer pool instance, how far down the buffer pool LRU list the page cleaner thread scans looking for dirty pages to flush. This is a background operation performed once a second.A setting smaller than the default is generally suitable for most workloads. A value that is much higher than necessary may impact performance. Only consider increasing the value if you have spare I/O capacity under a typical workload. Conversely, if a write-intensive workload saturates your I/O capacity, decrease the value, especially in the case of a large buffer pool.
When tuning
innodb_lru_scan_depth, start with a low value and configure the setting upward with the goal of rarely seeing zero free pages. Also, consider adjustinginnodb_lru_scan_depthwhen changing the number of buffer pool instances, sinceinnodb_lru_scan_depth*innodb_buffer_pool_instancesdefines the amount of work performed by the page cleaner thread each second.For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.
-
Command-Line Format --innodb_max_dirty_pages_pct=#System Variable Name innodb_max_dirty_pages_pctVariable Scope Global Dynamic Variable Yes Permitted Values (<= 5.7.4) Type numeric Default 75Min Value 0Max Value 99Permitted Values (>= 5.7.5) Type numeric Default 75Min Value 0Max Value 99.99InnoDBtries to flush data from the buffer pool so that the percentage of dirty pages does not exceed this value. The default value is 75.The
innodb_max_dirty_pages_pctsetting establishes a target for flushing activity. It does not affect the rate of flushing. For information about managing the rate of flushing, see Section 15.6.3.6, “Configuring InnoDB Buffer Pool Flushing”.For additional information about this variable, see Section 15.6.3.7, “Fine-tuning InnoDB Buffer Pool Flushing”. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.
innodb_max_dirty_pages_pct_lwmCommand-Line Format --innodb_max_dirty_pages_pct_lwm=#System Variable Name innodb_max_dirty_pages_pct_lwmVariable Scope Global Dynamic Variable Yes Permitted Values (<= 5.7.4) Type numeric Default 0Min Value 0Max Value 99Permitted Values (>= 5.7.5) Type numeric Default 0Min Value 0Max Value 99.99Low water mark representing percentage of dirty pages where preflushing is enabled to control the dirty page ratio. The default of 0 disables the pre-flushing behavior entirely. For additional information about this variable, see Section 15.6.3.7, “Fine-tuning InnoDB Buffer Pool Flushing”.
-
Command-Line Format --innodb_max_purge_lag=#System Variable Name innodb_max_purge_lagVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 0Min Value 0Max Value 4294967295This variable controls how to delay
INSERT,UPDATE, andDELETEoperations when purge operations are lagging (see Section 15.3, “InnoDB Multi-Versioning”). The default value is 0 (no delays).The
InnoDBtransaction system maintains a list of transactions that have index records delete-marked byUPDATEorDELETEoperations. The length of this list represents thepurge_lagvalue. Whenpurge_lagexceedsinnodb_max_purge_lag, eachINSERT,UPDATE, andDELETEoperation is delayed.To prevent excessive delays in extreme situations where
purge_lagbecomes huge, you can put a cap on the amount of delay by setting theinnodb_max_purge_lag_delayconfiguration option. The delay is computed at the beginning of a purge batch.A typical setting for a problematic workload might be 1 million, assuming that transactions are small, only 100 bytes in size, and it is permissible to have 100MB of unpurged
InnoDBtable rows.The lag value is displayed as the history list length in the
TRANSACTIONSsection of InnoDB Monitor output. For example, if the output includes the following lines, the lag value is 20:------------ TRANSACTIONS ------------ Trx id counter 0 290328385 Purge done for trx's n:o < 0 290315608 undo n:o < 0 17 History list length 20
For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.
-
Command-Line Format --innodb_max_purge_lag_delay=#System Variable Name innodb_max_purge_lag_delayVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 0Min Value 0Specifies the maximum delay in milliseconds for the delay imposed by the
innodb_max_purge_lagconfiguration option. Any non-zero value represents an upper limit on the delay period computed from the formula based on the value ofinnodb_max_purge_lag. The default of zero means that there is no upper limit imposed on the delay interval.For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.
-
Introduced 5.7.5 Command-Line Format --innodb_max_undo_log_size=#System Variable Name innodb_max_undo_log_sizeVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 1073741824Min Value 10485760Max Value 2**64-1innodb_max_undo_log_sizedefines a threshold size for undo tablespaces. If an undo tablespace exceeds the threshold, it can be marked for truncation wheninnodb_undo_log_truncateis enabled. The default value is 1024 MiB (1073741824 bytes).For more information, see Section 15.7.8, “Truncating Undo Logs That Reside in Undo Tablespaces”.
innodb_merge_threshold_set_all_debugIntroduced 5.7.6 Command-Line Format --innodb_merge_threshold_set_all_debug=#System Variable Name innodb_merge_threshold_set_all_debugVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 50Min Value 1Max Value 50Overrides the current
MERGE_THRESHOLDsetting with the specified value for all indexes that are currently in the dictionary cache. This option is only available if debugging support is compiled in using theWITH_DEBUGCMake option. For related information, see Section 15.6.12, “Configuring the Merge Threshold for Index Pages”.-
Command-Line Format --innodb_monitor_disable=[counter|module|pattern|all]System Variable Name innodb_monitor_disableVariable Scope Global Dynamic Variable Yes Permitted Values Type string Turns off one or more counters in the
INFORMATION_SCHEMA.INNODB_METRICStable. For usage information, see Section 23.31.15, “The INFORMATION_SCHEMA INNODB_METRICS Table”.As of MySQL 5.7.8,
innodb_monitor_disable='latch'disables statistics collection forSHOW ENGINE INNODB MUTEX. For more information, see Section 14.7.5.15, “SHOW ENGINE Syntax”. -
Command-Line Format --innodb_monitor_enable=[counter|module|pattern|all]System Variable Name innodb_monitor_enableVariable Scope Global Dynamic Variable Yes Permitted Values Type string Turns on one or more counters in the
INFORMATION_SCHEMA.INNODB_METRICStable. For usage information, see Section 23.31.15, “The INFORMATION_SCHEMA INNODB_METRICS Table”.As of MySQL 5.7.8,
innodb_monitor_enable='latch'enables statistics collection forSHOW ENGINE INNODB MUTEX. For more information, see Section 14.7.5.15, “SHOW ENGINE Syntax”. -
Command-Line Format --innodb_monitor_reset=[counter|module|pattern|all]System Variable Name innodb_monitor_resetVariable Scope Global Dynamic Variable Yes Permitted Values Type string Resets to zero the count value for one or more counters in the
INFORMATION_SCHEMA.INNODB_METRICStable. For usage information, see Section 23.31.15, “The INFORMATION_SCHEMA INNODB_METRICS Table”.As of MySQL 5.7.8,
innodb_monitor_reset='latch'resets statistics reported bySHOW ENGINE INNODB MUTEX. For more information, see Section 14.7.5.15, “SHOW ENGINE Syntax”. -
Command-Line Format --innodb_monitor_reset_all=[counter|module|pattern|all]System Variable Name innodb_monitor_reset_allVariable Scope Global Dynamic Variable Yes Permitted Values Type string Resets all values (minimum, maximum, and so on) for one or more counters in the
INFORMATION_SCHEMA.INNODB_METRICStable. For usage information, see Section 23.31.15, “The INFORMATION_SCHEMA INNODB_METRICS Table”. -
Introduced 5.7.9 Command-Line Format --innodb_numa_interleave=#System Variable Name innodb_numa_interleaveVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default OFFEnables the NUMA interleave memory policy for allocation of the
InnoDBbuffer pool. Wheninnodb_numa_interleaveis enabled, the NUMA memory policy is set toMPOL_INTERLEAVEfor the mysqld process. After theInnoDBbuffer pool is allocated, the NUMA memory policy is set back toMPOL_DEFAULT. For theinnodb_numa_interleaveoption to be available, MySQL must be compiled on a NUMA-enabled Linux system. -
Command-Line Format --innodb_old_blocks_pct=#System Variable Name innodb_old_blocks_pctVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 37Min Value 5Max Value 95Specifies the approximate percentage of the
InnoDBbuffer pool used for the old block sublist. The range of values is 5 to 95. The default value is 37 (that is, 3/8 of the pool). Often used in combination withinnodb_old_blocks_time. See Section 15.6.3.4, “Making the Buffer Pool Scan Resistant” for more information. See Section 15.6.3.1, “The InnoDB Buffer Pool” for information about buffer pool management, such as the LRU algorithm and eviction policies. -
Command-Line Format --innodb_old_blocks_time=#System Variable Name innodb_old_blocks_timeVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 1000Min Value 0Max Value 2**32-1Non-zero values protect against the buffer pool being filled up by data that is referenced only for a brief period, such as during a full table scan. Increasing this value offers more protection against full table scans interfering with data cached in the buffer pool.
Specifies how long in milliseconds (ms) a block inserted into the old sublist must stay there after its first access before it can be moved to the new sublist. If the value is 0, a block inserted into the old sublist moves immediately to the new sublist the first time it is accessed, no matter how soon after insertion the access occurs. If the value is greater than 0, blocks remain in the old sublist until an access occurs at least that many ms after the first access. For example, a value of 1000 causes blocks to stay in the old sublist for 1 second after the first access before they become eligible to move to the new sublist.
The default value is 1000.
This variable is often used in combination with
innodb_old_blocks_pct. See Section 15.6.3.4, “Making the Buffer Pool Scan Resistant” for more information. See Section 15.6.3.1, “The InnoDB Buffer Pool” for information about buffer pool management, such as the LRU algorithm and eviction policies. innodb_online_alter_log_max_sizeCommand-Line Format --innodb_online_alter_log_max_size=#System Variable Name innodb_online_alter_log_max_sizeVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 134217728Min Value 65536Max Value 2**64-1Specifies an upper limit on the size of the temporary log files used during online DDL operations for
InnoDBtables. There is one such log file for each index being created or table being altered. This log file stores data inserted, updated, or deleted in the table during the DDL operation. The temporary log file is extended when needed by the value ofinnodb_sort_buffer_size, up to the maximum specified byinnodb_online_alter_log_max_size. If any temporary log file exceeds the upper size limit, theALTER TABLEoperation fails and all uncommitted concurrent DML operations are rolled back. Thus, a large value for this option allows more DML to happen during an online DDL operation, but also causes a longer period at the end of the DDL operation when the table is locked to apply the data from the log.-
Command-Line Format --innodb_open_files=#System Variable Name innodb_open_filesVariable Scope Global Dynamic Variable No Permitted Values Type integer Default -1 (autosized)Min Value 10Max Value 4294967295This variable is relevant only if you use multiple
InnoDBtablespaces. It specifies the maximum number of.ibdfiles that MySQL can keep open at one time. The minimum value is 10. The default value is 300 ifinnodb_file_per_tableis not enabled, and the higher of 300 andtable_open_cacheotherwise.The file descriptors used for
.ibdfiles are forInnoDBtables only. They are independent of those specified by the--open-files-limitserver option, and do not affect the operation of the table cache. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”. -
Command-Line Format --innodb_optimize_fulltext_only=#System Variable Name innodb_optimize_fulltext_onlyVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFChanges the way the
OPTIMIZE TABLEstatement operates onInnoDBtables. Intended to be enabled temporarily, during maintenance operations forInnoDBtables withFULLTEXTindexes.By default,
OPTIMIZE TABLEreorganizes the data in the clustered index of the table. When this option is enabled,OPTIMIZE TABLEskips this reorganization of the table data, and instead processes the newly added, deleted, and updated token data for aFULLTEXTindex, See Section 15.8.10, “InnoDB FULLTEXT Indexes” for more information aboutFULLTEXTindexes forInnoDBtables. -
Introduced 5.7.5 Removed 5.7.6 Command-Line Format --innodb_optimize_point_storage=#System Variable Name innodb_optimize_point_storageVariable Scope Session Dynamic Variable Yes Permitted Values Type boolean Default OFFEnable this variable before creating a column of type
POINTto store thePOINTdata type internally as variable-lengthBLOBdata.This variable was removed in MySQL 5.7.6.
-
Introduced 5.7.4 Command-Line Format --innodb_page_cleaners=#System Variable Name innodb_page_cleanersVariable Scope Global Dynamic Variable No Permitted Values (<= 5.7.7) Type integer Default 1Min Value 1Max Value 64Permitted Values (>= 5.7.8) Type integer Default 4Min Value 1Max Value 64The number of page cleaner threads that flush dirty pages from buffer pool instances. The page cleaner threads perform flush list and LRU flushing. A single page cleaner thread was introduced in MySQL 5.6.2 to offload buffer pool flushing work from the
InnoDBmaster thread. As of MySQL 5.7.4,InnoDBprovides support for multiple page cleaner threads. A value of 1 maintains the pre-MySQL 5.7.4 configuration in which there is a single page cleaner thread. When there are multiple page cleaner threads, buffer pool flushing tasks for each buffer pool instance are dispatched to idle page cleaner threads. Theinnodb_page_cleanersdefault value was changed from 1 to 4 in MySQL 5.7.8. If the number of page cleaner threads exceeds the number of buffer pool instances,innodb_page_cleanersis automatically set to the same value asinnodb_buffer_pool_instances.If your workload is write-IO bound (when flushing dirty pages from buffer pool instances to data files) and if your system hardware has available capacity, increasing the number of page cleaner threads may help improve write-IO throughput.
Multi-threaded page cleaner support is extended to shutdown and recovery phases in MySQL 5.7.5.
As of MySQL 5.7.6, the
setpriority()system call is used on Linux platforms (where it is supported and where the mysqld execution user is authorized) to givepage_cleanerthreads priority over other MySQL/InnoDB threads to help page flushing keep pace with the current workload. mysqld execution user authorization can be configured in/etc/security/limits.conf. For example, if mysqld is run under themysqluser, you might authorize themysqluser by adding lines similar to the following to/etc/security/limits.conf:mysql hard nice -20 mysql soft nice -20
Refer to your Linux operating system documentation for more information.
-
Command-Line Format --innodb_page_size=#kSystem Variable Name innodb_page_sizeVariable Scope Global Dynamic Variable No Permitted Values (<= 5.7.5) Type enumeration Default 16384Valid Values 4k8k16k4096819216384Permitted Values (>= 5.7.6) Type enumeration Default 16384Valid Values 4k8k16k32k64k40968192163843276865536Specifies the page size for all
InnoDBtablespaces in a MySQL instance. You can specify page size using the values 64k, 32k,16k(the default),8k, or4k. Alternatively, you can specify page size in bytes (65536, 32768, 16384, 8192, 4096).Importantinnodb_page_sizecan only be configured prior to initializing the MySQL instance and cannot be changed afterward. If no value is specified, the instance is initialized using the default page size.Support for 32k and 64k page sizes was added in MySQL 5.7.6. For both 32k and 64k page sizes, the maximum row length is approximately 16000 bytes.
ROW_FORMAT=COMPRESSEDis not supported wheninnodb_page_sizeis set to 32KB or 64KB. Forinnodb_page_size=32k, extent size is 2MB. Forinnodb_page_size=64k, extent size is 4MB.innodb_log_buffer_sizeshould be set to at least 16M (which is the default as of MySQL 5.7.6) when using 32k or 64k page sizes.The default page size of 16KB and larger is appropriate for a wide range of workloads, particularly for queries involving table scans and DML operations involving bulk updates. Smaller page sizes might be more efficient for OLTP workloads involving many small writes, where contention can be an issue when a single page contains many rows. Smaller pages might also be efficient with SSD storage devices, which typically use small block sizes. Keeping the
InnoDBpage size close to the storage device block size minimizes the amount of unchanged data that is rewritten to disk.The minimum file size for the first system tablespace data file (
ibdata1) differs depending on theinnodb_page_sizevalue. See theinnodb_data_file_pathoption description for more information.For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.
-
Command-Line Format --innodb_print_all_deadlocks=#System Variable Name innodb_print_all_deadlocksVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFWhen this option is enabled, information about all deadlocks in
InnoDBuser transactions is recorded in themysqlderror log. Otherwise, you see information about only the last deadlock, using theSHOW ENGINE INNODB STATUScommand. An occasionalInnoDBdeadlock is not necessarily an issue, becauseInnoDBdetects the condition immediately, and rolls back one of the transactions automatically. You might use this option to troubleshoot why deadlocks are happening if an application does not have appropriate error-handling logic to detect the rollback and retry its operation. A large number of deadlocks might indicate the need to restructure transactions that issue DML orSELECT ... FOR UPDATEstatements for multiple tables, so that each transaction accesses the tables in the same order, thus avoiding the deadlock condition. -
Command-Line Format --innodb_purge_batch_size=#System Variable Name innodb_purge_batch_sizeVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 300Min Value 1Max Value 5000Defines the number of undo log pages that purge parses and processes in one batch from the history list. In a multi-threaded purge configuration, the coordinator purge thread divides
innodb_purge_batch_sizebyinnodb_purge_threadsand assigns that number of pages to each purge thread. Theinnodb_purge_batch_sizeoption also defines the number of undo log pages that purge frees after every 128 iterations through the undo logs.The
innodb_purge_batch_sizeoption is intended for advanced performance tuning in combination with theinnodb_purge_threadssetting. Most MySQL users need not changeinnodb_purge_batch_sizefrom its default value. -
Command-Line Format --innodb_purge_threads=#System Variable Name innodb_purge_threadsVariable Scope Global Dynamic Variable No Permitted Values (<= 5.7.7) Type integer Default 1Min Value 1Max Value 32Permitted Values (>= 5.7.8) Type integer Default 4Min Value 1Max Value 32The number of background threads devoted to the
InnoDBpurge operation. A minimum value of 1 signifies that the purge operation is always performed by a background thread, never as part of the master thread. Running the purge operation in one or more background threads helps reduce internal contention withinInnoDB, improving scalability. Increasing the value to greater than 1 creates that many separate purge threads, which can improve efficiency on systems where DML operations are performed on multiple tables. The maximum is 32.The
innodb_purge_threadsdefault value was changed from 1 to 4 in MySQL 5.7.8. innodb_purge_rseg_truncate_frequencyIntroduced 5.7.5 Command-Line Format --innodb_purge_rseg_truncate_frequency=#System Variable Name innodb_purge_rseg_truncate_frequencyVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 128Min Value 1Max Value 128innodb_purge_rseg_truncate_frequencydefines the frequency with which the purge system frees rollback segments. An undo tablespace cannot be truncated until its rollback segments are freed. Normally, the purge system frees rollback segments once every 128 times that purge is invoked. Reducing theinnodb_purge_rseg_truncate_frequencyvalue increases the frequency with which the purge thread frees rollback segments. The default value is 128.innodb_purge_rseg_truncate_frequencyis intended for use withinnodb_undo_log_truncate. For more information, see Section 15.7.8, “Truncating Undo Logs That Reside in Undo Tablespaces”.-
Command-Line Format --innodb_random_read_ahead=#System Variable Name innodb_random_read_aheadVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFEnables the random read-ahead technique for optimizing
InnoDBI/O.See Section 15.6.3.5, “Configuring InnoDB Buffer Pool Prefetching (Read-Ahead)” for details about the performance considerations for the different types of read-ahead requests. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.
-
Command-Line Format --innodb_read_ahead_threshold=#System Variable Name innodb_read_ahead_thresholdVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 56Min Value 0Max Value 64Controls the sensitivity of linear read-ahead that
InnoDBuses to prefetch pages into the buffer pool. IfInnoDBreads at leastinnodb_read_ahead_thresholdpages sequentially from an extent (64 pages), it initiates an asynchronous read for the entire following extent. The permissible range of values is 0 to 64. A value of 0 disables read-ahead. For the default of 56,InnoDBmust read at least 56 pages sequentially from an extent to initiate an asynchronous read for the following extent.Knowing how many pages are read through this read-ahead mechanism, and how many of them are evicted from the buffer pool without ever being accessed, can be useful to help fine-tune the
innodb_read_ahead_thresholdparameter. As of MySQL 5.5,SHOW ENGINE INNODB STATUSoutput displays counter information from theInnodb_buffer_pool_read_aheadandInnodb_buffer_pool_read_ahead_evictedglobal status variables. These variables indicate the number of pages brought into the buffer pool by read-ahead requests, and the number of such pages evicted from the buffer pool without ever being accessed respectively. These counters provide global values since the last server restart.SHOW ENGINE INNODB STATUSalso shows the rate at which the read-ahead pages are read in and the rate at which such pages are evicted without being accessed. The per-second averages are based on the statistics collected since the last invocation ofSHOW ENGINE INNODB STATUSand are displayed in theBUFFER POOL AND MEMORYsection of the output.See Section 15.6.3.5, “Configuring InnoDB Buffer Pool Prefetching (Read-Ahead)” for more information. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.
-
Command-Line Format --innodb_read_io_threads=#System Variable Name innodb_read_io_threadsVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 4Min Value 1Max Value 64The number of I/O threads for read operations in
InnoDB. The default value is 4. Its counterpart for write threads isinnodb_write_io_threads. See Section 15.6.7, “Configuring the Number of Background InnoDB I/O Threads” for more information. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.NoteOn Linux systems, running multiple MySQL servers (typically more than 12) with default settings for
innodb_read_io_threads,innodb_write_io_threads, and the Linuxaio-max-nrsetting can exceed system limits. Ideally, increase theaio-max-nrsetting; as a workaround, you might reduce the settings for one or both of the MySQL configuration options. -
Command-Line Format --innodb_read_only=#System Variable Name innodb_read_onlyVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default OFFStarts
InnoDBin read-only mode. For distributing database applications or data sets on read-only media. Can also be used in data warehouses to share the same data directory between multiple instances. See Section 15.6.2, “Configuring InnoDB for Read-Only Operation” for usage instructions. -
Command-Line Format --innodb_replication_delay=#System Variable Name innodb_replication_delayVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 0Min Value 0Max Value 4294967295The replication thread delay (in ms) on a slave server if
innodb_thread_concurrencyis reached. -
Command-Line Format --innodb_rollback_on_timeoutSystem Variable Name innodb_rollback_on_timeoutVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default OFFIn MySQL 5.7,
InnoDBrolls back only the last statement on a transaction timeout by default. If--innodb_rollback_on_timeoutis specified, a transaction timeout causesInnoDBto abort and roll back the entire transaction. -
Command-Line Format --innodb_rollback_segments=#System Variable Name innodb_rollback_segmentsVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 128Min Value 1Max Value 128Defines how many of the rollback segments in the system tablespace are used for InnoDB transactions. This setting, while still valid, is replaced by
innodb_undo_logs. innodb_saved_page_number_debugCommand-Line Format --innodb_saved_page_number_debug=#System Variable Name innodb_saved_page_number_debugVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 0Max Value 2**23-1Saves a page number. Setting the
innodb_fil_make_page_dirty_debugoption dirties the page defined byinnodb_saved_page_number_debug. Theinnodb_saved_page_number_debugoption is only available if debugging support is compiled in using theWITH_DEBUGCMake option.-
Command-Line Format --innodb_sort_buffer_size=#System Variable Name innodb_sort_buffer_sizeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 1048576Min Value 65536Max Value 67108864Specifies the size of sort buffers used for sorting data during creation of an
InnoDBindex. The size specified defines the amount of data filled in memory for an internal sort and written out to disk, which can be referred to as a “run”. During the merge phase, pairs of buffers of the specified size are “read in” and merged. The larger the setting, the fewer “runs” and merges there are, which is important to understand from a tuning perspective.This sort area is only used for merge sorts during index creation, not during later index maintenance operations. Buffers are deallocated when index creation completes.
The value of this option also controls the amount by which the temporary log file is extended, to record concurrent DML during online DDL operations.
Before this setting was made configurable, the size was hardcoded to 1048576 bytes (1MB), and that value remains the default.
During an
ALTER TABLEorCREATE TABLEstatement that creates an index, 3 buffers are allocated, each with a size defined by this option. Additionally, auxiliary pointers are allocated to rows in the sort buffer so that the sort can run on pointers (as opposed to moving rows during the sort operation).For a typical sort operation, a formula such as this can be used to estimate memory consumption:
(6 /*FTS_NUM_AUX_INDEX*/ * (3*@@global.innodb_sort_buffer_size) + 2 * number_of_partitions * number_of_secondary_indexes_created * (@@global.innodb_sort_buffer_size/dict_index_get_min_size(index)*/) * 8 /*64-bit sizeof *buf->tuples*/")
@@global.innodb_sort_buffer_size/dict_index_get_min_size(index)indicates the maximum tuples held.2 * (@@global.innodb_sort_buffer_size/*dict_index_get_min_size(index)*/) * 8 /*64-bit size of *buf->tuples*/indicates auxiliary pointers allocated.NoteFor 32-bit, multiply by 4 instead of 8.
For parallel sorts on a full-text index, multiply by the
innodb_ft_sort_pll_degreesetting:(6 /*FTS_NUM_AUX_INDEX*/ * @@global.innodb_ft_sort_pll_degree)
-
Command-Line Format --innodb_spin_wait_delay=#System Variable Name innodb_spin_wait_delayVariable Scope Global Dynamic Variable Yes Permitted Values (32-bit platforms) Type integer Default 6Min Value 0Max Value 2**32-1Permitted Values (64-bit platforms) Type integer Default 6Min Value 0Max Value 2**64-1The maximum delay between polls for a spin lock. The low-level implementation of this mechanism varies depending on the combination of hardware and operating system, so the delay does not correspond to a fixed time interval. The default value is 6. See Section 15.6.9, “Configuring Spin Lock Polling” for more information.
-
Command-Line Format --innodb_stats_auto_recalc=#System Variable Name innodb_stats_auto_recalcVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default ONCauses
InnoDBto automatically recalculate persistent statistics after the data in a table is changed substantially. The threshold value is currently 10% of the rows in the table. This setting applies to tables created when theinnodb_stats_persistentoption is enabled, or where the clauseSTATS_PERSISTENT=1is enabled by aCREATE TABLEorALTER TABLEstatement. The amount of data sampled to produce the statistics is controlled by theinnodb_stats_persistent_sample_pagesconfiguration option.For additional information about
innodb_stats_auto_recalc, see Section 15.6.11.1, “Configuring Persistent Optimizer Statistics Parameters”. innodb_stats_include_delete_markedIntroduced 5.7.17 Command-Line Format --innodb_stats_include_delete_marked=#System Variable Name innodb_stats_include_delete_markedVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFBy default,
InnoDBreads uncommitted data when calculating statistics. In the case of an uncommitted transaction that deletes rows from a table,InnoDBexcludes records that are delete-marked when calculating row estimates and index statistics, which can lead to non-optimal execution plans for other transactions that are operating on the table concurrently using a transaction isolation level other thanREAD UNCOMMITTED. To avoid this scenario,innodb_stats_include_delete_markedcan be enabled to ensure thatInnoDBincludes delete-marked records when calculating persistent optimizer statistics.When
innodb_stats_include_delete_markedis enabled,ANALYZE TABLEconsiders delete-marked records when recalculating statistics.innodb_stats_include_delete_markedis a global setting that affects allInnoDBtables, and it is only applicable to persistent optimizer statistics.For related information, see Section 15.6.11.1, “Configuring Persistent Optimizer Statistics Parameters”.
-
Command-Line Format --innodb_stats_method=nameSystem Variable Name innodb_stats_methodVariable Scope Global Dynamic Variable Yes Permitted Values Type enumeration Default nulls_equalValid Values nulls_equalnulls_unequalnulls_ignoredHow the server treats
NULLvalues when collecting statistics about the distribution of index values forInnoDBtables. This variable has three possible values,nulls_equal,nulls_unequal, andnulls_ignored. Fornulls_equal, allNULLindex values are considered equal and form a single value group that has a size equal to the number ofNULLvalues. Fornulls_unequal,NULLvalues are considered unequal, and eachNULLforms a distinct value group of size 1. Fornulls_ignored,NULLvalues are ignored.The method that is used for generating table statistics influences how the optimizer chooses indexes for query execution, as described in Section 9.3.7, “InnoDB and MyISAM Index Statistics Collection”.
-
Command-Line Format --innodb_stats_on_metadataSystem Variable Name innodb_stats_on_metadataVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFWhen this variable is enabled,
InnoDBupdates statistics when metadata statements such asSHOW TABLE STATUSor when accessing theINFORMATION_SCHEMA.TABLESorINFORMATION_SCHEMA.STATISTICStables. (These updates are similar to what happens forANALYZE TABLE.) When disabled,InnoDBdoes not update statistics during these operations. Leaving this setting disabled can improve access speed for schemas that have a large number of tables or indexes. It can also improve the stability of execution plans for queries that involveInnoDBtables.To change the setting, issue the statement
SET GLOBAL innodb_stats_on_metadata=, wheremodeis eithermodeONorOFF(or1or0). Changing this setting requires theSUPERprivilege and immediately affects the operation of all connections.This variable is disabled by default.
-
Command-Line Format --innodb_stats_persistent=settingSystem Variable Name innodb_stats_persistentVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default ONValid Values OFFON01Specifies whether
InnoDBindex statistics are persisted to disk. Otherwise, statistics may be recalculated frequently which can lead to variations in query execution plans. This setting is stored with each table when the table is created. You can setinnodb_stats_persistentat the global level before creating a table, or use theSTATS_PERSISTENTclause of theCREATE TABLEandALTER TABLEstatements to override the system-wide setting and configure persistent statistics for individual tables.For more information about this option, see Section 15.6.11.1, “Configuring Persistent Optimizer Statistics Parameters”.
innodb_stats_persistent_sample_pagesCommand-Line Format --innodb_stats_persistent_sample_pages=#System Variable Name innodb_stats_persistent_sample_pagesVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 20The number of index pages to sample when estimating cardinality and other statistics for an indexed column, such as those calculated by
ANALYZE TABLE. Increasing the value improves the accuracy of index statistics, which can improve the query execution plan, at the expense of increased I/O during the execution ofANALYZE TABLEfor anInnoDBtable. For additional information, see Section 15.6.11.1, “Configuring Persistent Optimizer Statistics Parameters”.NoteSetting a high value for
innodb_stats_persistent_sample_pagescould result in lengthyANALYZE TABLEexecution time. To estimate the number of database pages that will be accessed, see Section 15.6.11.3, “Estimating ANALYZE TABLE Complexity for InnoDB Tables”.This option only applies when the
innodb_stats_persistentsetting is turned on for a table; when that option is turned off for a table, theinnodb_stats_transient_sample_pagessetting applies instead.-
Deprecated 5.6.3 Command-Line Format --innodb_stats_sample_pages=#System Variable Name innodb_stats_sample_pagesVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 8Min Value 1Max Value 2**64-1Deprecated, use
innodb_stats_transient_sample_pagesinstead. innodb_stats_transient_sample_pagesCommand-Line Format --innodb_stats_transient_sample_pages=#System Variable Name innodb_stats_transient_sample_pagesVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 8The number of index pages to sample when estimating cardinality and other statistics for an indexed column, such as those calculated by
ANALYZE TABLE. The default value is 8. Increasing the value improves the accuracy of index statistics, which can improve the query execution plan, at the expense of increased I/O when opening anInnoDBtable or recalculating statistics. For additional information, see Section 15.6.11.2, “Configuring Non-Persistent Optimizer Statistics Parameters”.NoteSetting a high value for
innodb_stats_transient_sample_pagescould result in lengthyANALYZE TABLEexecution time. To estimate the number of database pages that will be accessed, see Section 15.6.11.3, “Estimating ANALYZE TABLE Complexity for InnoDB Tables”.This option only applies when the
innodb_stats_persistentsetting is turned off for a table; when this option is turned on for a table, theinnodb_stats_persistent_sample_pagessetting applies instead. Takes the place of theinnodb_stats_sample_pagesoption. See Section 15.6.11.2, “Configuring Non-Persistent Optimizer Statistics Parameters” for more information.-
Introduced 5.7.4 Command-Line Format --innodb_status_outputSystem Variable Name innodb_status_outputVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFEnables or disables periodic output for the standard
InnoDBMonitor. Also used in combination withinnodb_status_output_locksto enable or disable periodic output for theInnoDBLock Monitor. See Section 15.17, “InnoDB Monitors” for additional information. -
Introduced 5.7.4 Command-Line Format --innodb_status_output_locksSystem Variable Name innodb_status_output_locksVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFEnables or disables the
InnoDBLock Monitor. When enabled, theInnoDBLock Monitor prints additional information about locks inSHOW ENGINE INNODB STATUSoutput and in periodic output printed to the MySQL error log. Periodic output for theInnoDBLock Monitor is printed as part of the standardInnoDBMonitor output. The standardInnoDBMonitor must therefore be enabled for theInnoDBLock Monitor to print data to the MySQL error log periodically. See Section 15.17, “InnoDB Monitors” for more information. -
Command-Line Format --innodb_strict_mode=#System Variable Name innodb_strict_modeVariable Scope Global, Session Dynamic Variable Yes Permitted Values (<= 5.7.6) Type boolean Default OFFPermitted Values (>= 5.7.7) Type boolean Default ONWhen
innodb_strict_modeisON,InnoDBreturns errors rather than warnings for certain conditions. As of MySQL 5.7.7, the default value isON.Strict mode helps guard against ignored typos and syntax errors in SQL, or other unintended consequences of various combinations of operational modes and SQL statements. When
innodb_strict_modeisON,InnoDBraises error conditions in certain cases, rather than issuing a warning and processing the specified statement (perhaps with unintended behavior). This is analogous tosql_modein MySQL, which controls what SQL syntax MySQL accepts, and determines whether it silently ignores errors, or validates input syntax and data values.The
innodb_strict_modesetting affects the handling of syntax errors forCREATE TABLE,ALTER TABLE,CREATE INDEX, andOPTIMIZE TABLEstatements.innodb_strict_modealso enables a record size check, so that anINSERTorUPDATEnever fails due to the record being too large for the selected page size.Oracle recommends enabling
innodb_strict_modewhen usingROW_FORMATandKEY_BLOCK_SIZEclauses onCREATE TABLE,ALTER TABLE, andCREATE INDEXstatements. Wheninnodb_strict_modeisOFF,InnoDBignores conflicting clauses and creates the table or index, with only a warning in the message log. The resulting table might have different behavior than you intended, such as having no compression when you tried to create a compressed table. Wheninnodb_strict_modeisON, such problems generate an immediate error and the table or index is not created, avoiding a troubleshooting session later.You can turn
innodb_strict_modeONorOFFon the command line when you startmysqld, or in the configuration filemy.cnformy.ini. You can also enable or disableinnodb_strict_modeat runtime with the statementSET [GLOBAL|SESSION] innodb_strict_mode=, wheremodeis eithermodeONorOFF. Changing theGLOBALsetting requires theSUPERprivilege and affects the operation of all clients that subsequently connect. Any client can change theSESSIONsetting forinnodb_strict_mode, and the setting affects only that client.innodb_strict_modeis not applicable to general tablespaces. Tablespace management rules for general tablespaces are strictly enforced independently ofinnodb_strict_mode. For more information, see Section 14.1.19, “CREATE TABLESPACE Syntax”. -
Deprecated 5.7.10 Command-Line Format --innodb_support_xaSystem Variable Name innodb_support_xaVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type boolean Default TRUEEnables
InnoDBsupport for two-phase commit in XA transactions, causing an extra disk flush for transaction preparation. This setting is the default. The XA mechanism is used internally and is essential for any server that has its binary log turned on and is accepting changes to its data from more than one thread. If you turn it off, transactions can be written to the binary log in a different order from the one in which the live database is committing them. This can produce different data when the binary log is replayed in disaster recovery or on a replication slave. Do not turn it off on a replication master server unless you have an unusual setup where only one thread is able to change data.innodb_support_xais deprecated and will be removed in a future MySQL release.InnoDBsupport for two-phase commit in XA transactions is always enabled as of MySQL 5.7.10. Disablinginnodb_support_xais no longer permitted as it makes replication unsafe and prevents performance gains associated with binary log group commit. -
Command-Line Format --innodb_sync_array_size=#System Variable Name innodb_sync_array_sizeVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 1Min Value 1Max Value 1024Splits an internal data structure used to coordinate threads, for higher concurrency in workloads with large numbers of waiting threads. This setting must be configured when the MySQL instance is starting up, and cannot be changed afterward. Increasing this option value is recommended for workloads that frequently produce a large number of waiting threads, typically greater than 768.
-
Command-Line Format --innodb_sync_spin_loops=#System Variable Name innodb_sync_spin_loopsVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 30Min Value 0Max Value 4294967295The number of times a thread waits for an
InnoDBmutex to be freed before the thread is suspended. The default value is 30. -
Introduced 5.7.8 Command-Line Format --innodb_sync_debug=#System Variable Name innodb_sync_debugVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default OFFEnables sync debug checking for the
InnoDBstorage engine. This option is only available if debugging support is compiled in using theWITH_DEBUGCMake option.Prior to MySQL 5.7.8, enabling
InnoDBsync debug checking required that the Debug Sync facility be enabled using theENABLE_DEBUG_SYNCCMake option. This requirement was removed in MYSQL 5.7.8 with the introduction of theinnodb_sync_debugconfiguration option. -
Command-Line Format --innodb_table_locksSystem Variable Name innodb_table_locksVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type boolean Default TRUEIf
autocommit = 0,InnoDBhonorsLOCK TABLES; MySQL does not return fromLOCK TABLES ... WRITEuntil all other threads have released all their locks to the table. The default value ofinnodb_table_locksis 1, which means thatLOCK TABLEScauses InnoDB to lock a table internally ifautocommit = 0.In MySQL 5.7,
innodb_table_locks = 0has no effect for tables locked explicitly withLOCK TABLES ... WRITE. It does have an effect for tables locked for read or write byLOCK TABLES ... WRITEimplicitly (for example, through triggers) or byLOCK TABLES ... READ. -
Introduced 5.7.1 Command-Line Format --innodb_temp_data_file_path=fileSystem Variable Name innodb_temp_data_file_pathVariable Scope Global Dynamic Variable No Permitted Values Type string Default ibtmp1:12M:autoextendSpecifies the path, file name, and file size for
InnoDBtemporary tablespace data files. The full directory path for a file is formed by concatenatinginnodb_data_home_dirto the path specified byinnodb_temp_data_file_path. File size is specified in KB, MB, or GB (1024MB) by appendingK,M, orGto the size value. The sum of the sizes of the files must be slightly larger than 12MB. If you do not specifyinnodb_temp_data_file_path, the default behavior is to create a single auto-extending temporary tablespace data file, slightly larger than 12MB, namedibtmp1. The size limit of individual files is determined by your operating system. You can set the file size to more than 4GB on operating systems that support big files. Use of raw disk partitions for temporary tablespace data files is not supported.The name of a
InnoDBtemporary table tablespace data file cannot be the same as the name of aInnoDBdata file. Any inability or error creating a temporary tablespace data file is treated as fatal and server startup will be refused. The temporary table tablespace has a dynamically generated space ID, which can change on each server restart.The
InnoDBtemporary tablespace is shared by all non-compressedInnoDBtemporary tables. CompressedInnoDBtemporary tables reside in per-table tablespace files, which are located in the temporary file directory defined bytmpdir.Metadata about active
InnoDBtemporary tables is found inINFORMATION_SCHEMA.INNODB_TEMP_TABLE_INFO. -
Introduced 5.7.11 Command-Line Format --innodb_tmpdir=pathSystem Variable Name innodb_tmpdirVariable Scope Global, Session Dynamic Variable Yes Permitted Values Type directory name Default NULLThe
innodb_tmpdiroption is used to define an alternate directory for temporary sort files created during onlineALTER TABLEoperations that rebuild the table.Online
ALTER TABLEoperations that rebuild a table also create an intermediate table file in the same directory as the original table. Theinnodb_tmpdiroption is not applicable to intermediate table files.A valid value is any directory path other than the MySQL data directory path. If the value is NULL (the default), temporary files are created MySQL temporary directory (
$TMPDIRon Unix,%TEMP%on Windows, or the directory specified by the--tmpdirconfiguration option). If aninnodb_tmpdirdirectory is specified, existence of the directory and permissions are only checked wheninnodb_tmpdiris configured using aSETstatement. If a symlink is provided in a directory string, the symlink is resolved and stored as an absolute path. The path should not exceed 512 bytes. An onlineALTER TABLEoperation reports an error ifinnodb_tmpdiris set to an invalid directory.innodb_tmpdiroverrides the MySQLtmpdirsetting but only for onlineALTER TABLEoperations.The
FILEprivilege is required to configureinnodb_tmpdir.The
innodb_tmpdiroption was introduced to help avoid overflowing a temporary file directory located on atmpfsfile system. Such overflows could occur as a result of large temporary sort files created during onlineALTER TABLEoperations that rebuild the table.In replication environments, only consider replicating an
innodb_tmpdirsetting if all servers have the same operating system environment. Otherwise, replicating aninnodb_tmpdirsetting could result in a replication failure when running onlineALTER TABLEoperations that rebuild the table. If server operating environments differ, it is recommended that you configureinnodb_tmpdiron each server individually.For related information, see Where InnoDB Stores Temporary Files.
-
Command-Line Format --innodb_thread_concurrency=#System Variable Name innodb_thread_concurrencyVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 0Min Value 0Max Value 1000InnoDBtries to keep the number of operating system threads concurrently insideInnoDBless than or equal to the limit given by this variable (InnoDBuses operating system threads to process user transactions). Once the number of threads reaches this limit, additional threads are placed into a wait state within a “First In, First Out” (FIFO) queue for execution. Threads waiting for locks are not counted in the number of concurrently executing threads.The range of this variable is 0 to 1000. A value of 0 (the default) is interpreted as infinite concurrency (no concurrency checking). Disabling thread concurrency checking enables
InnoDBto create as many threads as it needs. A value of 0 also disables thequeries inside InnoDBandqueries in queue countersin theROW OPERATIONSsection ofSHOW ENGINE INNODB STATUSoutput.Consider setting this variable if your MySQL instance shares CPU resources with other applications, or if your workload or number of concurrent users is growing. The correct setting depends on workload, computing environment, and the version of MySQL that you are running. You will need to test a range of values to determine the setting that provides the best performance.
innodb_thread_concurrencyis a dynamic variable, which allows you to experiment with different settings on a live test system. If a particular setting performs poorly, you can quickly setinnodb_thread_concurrencyback to 0.Use the following guidelines to help find and maintain an appropriate setting:
If the number of concurrent user threads for a workload is less than 64, set
innodb_thread_concurrency=0.If your workload is consistently heavy or occasionally spikes, start by setting
innodb_thread_concurrency=128, and lowering the value to 96, 80, 64, and so on, until you find the number of threads that provides the best performance. For example, suppose your system typically has 40 to 50 users, but periodically the number increases to 60, 70, or even 200. You find that performance is stable at 80 concurrent users but starts to show a regression above this number. In this case, you would setinnodb_thread_concurrency=80to avoid impacting performance.If you do not want
InnoDBto use more than a certain number of vCPUs for user threads (20 vCPUs for example), setinnodb_thread_concurrencyto this number (or possibly lower, depending on performance results). If your goal is to isolate MySQL from other applications, you may consider binding themysqldprocess exclusively to the vCPUs. Be aware, however, that exclusive binding could result in non-optimal hardware usage if themysqldprocess is not consistently busy. In this case, you might bind themysqldprocess to the vCPUs but also allow other applications to use some or all of the vCPUs.NoteFrom an operating system perspective, using a resource management solution (if available) to manage how CPU time is shared among applications may be preferable to binding the
mysqldprocess. For example, you could assign 90% of vCPU time to a given application while other critical process are not running, and scale that value back to 40% when other critical processes are running.innodb_thread_concurrencyvalues that are too high can cause performance regression due to increased contention on system internals and resources.In some cases, the optimal
innodb_thread_concurrencysetting can be smaller than the number of vCPUs.Monitor and analyze your system regularly. Changes to workload, number of users, or computing environment may require that you adjust the
innodb_thread_concurrencysetting.
For related information, see Section 15.6.6, “Configuring Thread Concurrency for InnoDB”.
innodb_trx_purge_view_update_only_debugCommand-Line Format --innodb_trx_purge_view_update_only_debug=#System Variable Name innodb_trx_purge_view_update_only_debugVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFPauses purging of delete-marked records while allowing the purge view to be updated. This option artificially creates a situation in which the purge view is updated but purges have not yet been performed. This option is only available if debugging support is compiled in using the
WITH_DEBUGCMake option.-
Command-Line Format --innodb_trx_rseg_n_slots_debug=#System Variable Name innodb_trx_rseg_n_slots_debugVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 0Max Value 1024Sets a debug flag that limits
TRX_RSEG_N_SLOTSto a given value for thetrx_rsegf_undo_find_freefunction which looks for a free slot for an undo log segment. This option is only available if debugging support is compiled in using theWITH_DEBUGCMake option. -
Command-Line Format --innodb_thread_sleep_delay=#System Variable Name innodb_thread_sleep_delayVariable Scope Global Dynamic Variable Yes Permitted Values (>= 5.7.4) Type integer Default 10000Min Value 0Max Value 1000000Permitted Values (32-bit platforms, <= 5.7.3) Type integer Default 10000Min Value 0Max Value 4294967295Permitted Values (64-bit platforms, <= 5.7.3) Type integer Default 10000Min Value 0Max Value 18446744073709551615How long
InnoDBthreads sleep before joining theInnoDBqueue, in microseconds. The default value is 10000. A value of 0 disables sleep. In MySQL 5.6.3 and higher, you can set the configuration optioninnodb_adaptive_max_sleep_delayto the highest value you would allow forinnodb_thread_sleep_delay, and InnoDB automatically adjustsinnodb_thread_sleep_delayup or down depending on the current thread-scheduling activity. This dynamic adjustment helps the thread scheduling mechanism to work smoothly during times when the system is lightly loaded and when it is operating near full capacity.For more information, see Section 15.6.6, “Configuring Thread Concurrency for InnoDB”.
-
Command-Line Format --innodb_undo_directory=dir_nameSystem Variable Name innodb_undo_directoryVariable Scope Global Dynamic Variable No Permitted Values (<= 5.7.7) Type directory name Default .Permitted Values (>= 5.7.8) Type directory name The path where
InnoDBcreates separate tablespaces for the undo logs. Typically used to place undo logs on a different storage device. Used in conjunction withinnodb_undo_logsandinnodb_undo_tablespaces, which determine the disk layout of the undo logs outside the system tablespace.Prior to MySQL 5.7.8, the
innodb_undo_directorydefault value is “.”, which represents the same directory whereInnoDBcreates its other log files by default. As of MySQL 5.7.8, there is no default value (it is NULL). If a path is not specified, undo tablespaces are created in the MySQL data directory, as defined bydatadir.For more information about configuring separate tablespaces for undo logs, see Section 15.7.7, “Storing InnoDB Undo Logs in Separate Tablespaces”.
-
Introduced 5.7.5 Command-Line Format --innodb_undo_log_truncate=#System Variable Name innodb_undo_log_truncateVariable Scope Global Dynamic Variable Yes Permitted Values Type boolean Default OFFWhen you enable
innodb_undo_log_truncate, undo tablespaces that exceed the threshold value defined byinnodb_max_undo_log_sizeare marked for truncation. Only undo logs that reside in undo tablespaces can be truncated. Truncation of undo logs that reside in the system tablespace is not supported. For truncation to occur, there must be at least two undo tablespaces and two redo-enabled undo logs configured to use the undo tablespaces. This means thatinnodb_undo_tablespacesmust be set to a value equal to or greater than 2, andinnodb_undo_logsmust set to a value equal to or greater than 35.The
innodb_purge_rseg_truncate_frequencyconfiguration option can be used to expedite truncation of undo tablepaces.For more information, see Section 15.7.8, “Truncating Undo Logs That Reside in Undo Tablespaces”.
-
Command-Line Format --innodb_undo_logs=#System Variable Name innodb_undo_logsVariable Scope Global Dynamic Variable Yes Permitted Values Type integer Default 128Min Value 0Max Value 128Defines the number of rollback segments used by
InnoDB. Theinnodb_undo_logsoption replacesinnodb_rollback_segments.One rollback segment is always assigned to the system tablespace, and as of MySQL 5.7.2, 32 rollback segments are reserved for use by temporary tables and are hosted in the temporary tablespace (
ibtmp1). To allocate additional rollback segments for data-modifying transactions that generate undo records,innodb_undo_logsmust be set to a value greater than 33. If you configure separate undo tablespaces, the rollback segment in the system tablespace is rendered inactive. Each rollback segment can support a maximum of 1024 data-modifying transactions.When
innodb_undo_logsis set to 32 or less,InnoDBassigns one rollback segment to the system tablespace and 32 to the temporary tablespace (ibtmp1).When
innodb_undo_logsis set to a value greater than 32,InnoDBassigns one rollback segment to the system tablespace, 32 to the temporary tablespace (ibtmp1), and additional rollback segments to undo tablespaces, if present. If undo tabespaces are not present, additional rollback segments are assigned to the system tablespace.Although you can increase or decrease the number of rollback segments used by
InnoDB, the number of rollback segments physically present in the system never decreases. Thus you might start with a low value for this parameter and gradually increase it, to avoid allocating rollback segments that are not required. Ifinnodb_undo_logsis not set, it defaults to the maximum value of 128. For the total number of available rollback segments, rather than the number of active ones, see theInnodb_available_undo_logsstatus variable.For information about rollback segments, see Section 15.3, “InnoDB Multi-Versioning”. For information about configuring separate undo tablespaces, see Section 15.7.7, “Storing InnoDB Undo Logs in Separate Tablespaces”.
-
Command-Line Format --innodb_undo_tablespaces=#System Variable Name innodb_undo_tablespacesVariable Scope Global Dynamic Variable No Permitted Values (<= 5.7.7) Type integer Default 0Min Value 0Max Value 126Permitted Values (>= 5.7.8) Type integer Default 0Min Value 0Max Value 95The number of tablespace files that rollback segments are divided between. By default, rollback segments are assigned to the system tablespace, and the system tablespace is always assigned at least one rollback segment.
Because undo logs can become large during long-running transactions, having undo logs in multiple tablespaces reduces the maximum size of any one tablespace. The undo tablespace files are created in the location defined by
innodb_undo_directory, with names in the form ofundo, whereNNis a sequential series of integers (including leading zeros). The default size of an undo tablespace file is 10M.Importantinnodb_undo_tablespacescan only be configured prior to initializing the MySQL instance and cannot be changed afterward. If no value is specified, the instance is initialized using the default setting (0). Attempting to restartInnoDBwith a greater number of undo tablespaces than specified when the MySQL instance was initialized results in a startup failure and an error stating thatInnoDBdid not find the expected number of undo tablespaces.As MySQL 5.7.2, 32 of 128 rollback segments are reserved for temporary tables, as described in Section 15.4.12.1, “InnoDB Temporary Table Undo Logs”. One rollback segment is always assigned to the system tablespace, which leaves 95 rollback segments available for undo tablepaces. This change effectively reduces the
innodb_undo_tablespacesmaximum limit from 126 to 95, and in MySQL 5.7.8, theinnodb_undo_tablespacesmaximum value is reduced to 95.For information about configuring separate undo tablespaces, see Section 15.7.7, “Storing InnoDB Undo Logs in Separate Tablespaces”.
-
Command-Line Format --innodb_use_native_aio=#System Variable Name innodb_use_native_aioVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default ONSpecifies whether to use the Linux asynchronous I/O subsystem. This variable applies to Linux systems only, and cannot be changed while the server is running. Normally, you do not need to touch this option, because it is enabled by default.
As of MySQL 5.5, the asynchronous I/O capability that
InnoDBhas on Windows systems is available on Linux systems. (Other Unix-like systems continue to use synchronous I/O calls.) This feature improves the scalability of heavily I/O-bound systems, which typically show many pending reads/writes in the output of the commandSHOW ENGINE INNODB STATUS\G.Running with a large number of
InnoDBI/O threads, and especially running multiple such instances on the same server machine, can exceed capacity limits on Linux systems. In this case, you may receive the following error:EAGAIN: The specified maxevents exceeds the user's limit of available events.
You can typically address this error by writing a higher limit to
/proc/sys/fs/aio-max-nr.However, if a problem with the asynchronous I/O subsystem in the OS prevents
InnoDBfrom starting, you can start the server withinnodb_use_native_aio=0disabled (useinnodb_use_native_aio=0in the option file). This option may also be turned off automatically during startup ifInnoDBdetects a potential problem such as a combination oftmpdirlocation,tmpfsfilesystem, and Linux kernel that does not support AIO ontmpfs. -
Deprecated 5.6.3 Removed 5.7.4 Command-Line Format --innodb_use_sys_malloc=#System Variable Name innodb_use_sys_mallocVariable Scope Global Dynamic Variable No Permitted Values Type boolean Default ONWhether
InnoDBuses the operating system memory allocator (ON) or its own (OFF). The default value isON. See Section 15.6.4, “Configuring the Memory Allocator for InnoDB” for more information.innodb_use_sys_mallocwas deprecated in MySQL 5.6.3 and removed in MySQL 5.7.4. The
InnoDBversion number. In 5.7, the separate numbering forInnoDBdoes not apply and this value is the same as for theversionvariable.-
Command-Line Format --innodb_write_io_threads=#System Variable Name innodb_write_io_threadsVariable Scope Global Dynamic Variable No Permitted Values Type integer Default 4Min Value 1Max Value 64The number of I/O threads for write operations in
InnoDB. The default value is 4. Its counterpart for read threads isinnodb_read_io_threads. See Section 15.6.7, “Configuring the Number of Background InnoDB I/O Threads” for more information. For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.NoteOn Linux systems, running multiple MySQL servers (typically more than 12) with default settings for
innodb_read_io_threads,innodb_write_io_threads, and the Linuxaio-max-nrsetting can exceed system limits. Ideally, increase theaio-max-nrsetting; as a workaround, you might reduce the settings for one or both of the MySQL configuration options.You should also take into consideration the value of
sync_binlog, which controls synchronization of the binary log to disk.For general I/O tuning advice, see Section 9.5.8, “Optimizing InnoDB Disk I/O”.
* This limit varies in different kernels.
http://krow.livejournal.com/542306.html
This is particularly of importance when performing a file based sync to setup replication. If you have a different (or no) innodb_log_file_size setting at the slave, you will be puzzled for hours (I was).
[*] 2009/10 Initialising a 10 GB buffer pool takes 6 seconds, larger configurations may take proportionally longer.
http://www.tocker.ca/2013/09/17/what-to-tune-in-mysql-56-after-installation.html