MySQL InnoDB Storage Engine Performance Tuning Guide
| PARAMETER | DEFAULT | RECOMMENDED |
|---|---|---|
| innodb_buffer_pool_size InnoDB's most critical parameter. Caches all table and index data in memory. | 128M | 70-80% of RAM |
| innodb_buffer_pool_instances Divides buffer pool into instances to reduce concurrency contention. | 8 | 1 per GB (max 64) |
| innodb_buffer_pool_chunk_size Buffer pool size must be a multiple of this value. | 128M | pool_size / instances aligned |
| innodb_old_blocks_time Delay before moving blocks to LRU young sublist. | 1000ms | 1000ms (OLTP) 0 (Batch) |
| innodb_lru_scan_depth Page cleaner thread scan depth per buffer pool instance. | 1024 | 256-512 |
| PARAMETER | DEFAULT | RECOMMENDED |
|---|---|---|
| innodb_lock_wait_timeout Timeout in seconds waiting for an InnoDB row lock. | 50 | 30-120 |
| innodb_deadlock_detect Automatic deadlock detection. Disabling under extreme concurrency is debated. | ON | ON |
| innodb_rollback_on_timeout Rolls back entire transaction on timeout (not just last statement). | OFF | ON (optional) |
| transaction_isolation READ COMMITTED reduces gap locks. RR recommended for GTID replication. | REPEATABLE-READ | RC (high concurrency) |
| innodb_autoinc_lock_mode Lock mode used for generating AUTO_INCREMENT values in bulk inserts. | 1 | 2 (interleaved) |
| innodb_print_all_deadlocks Prints all deadlocks to the error log. Keep enabled for diagnostics. | OFF | ON |
innodb_log_file_size × log_files_in_group, trigger critical alert!| PARAMETER | DEFAULT | RECOMMENDED |
|---|---|---|
| innodb_log_file_size Redo log file size. Larger value = less checkpoint I/O overhead. | 48M | 1-4 GB |
| innodb_log_buffer_size Redo log buffer size. Increase for large transactions. | 16M | 64-256 MB |
| innodb_flush_log_at_trx_commit 1=strict ACID, 2=up to 1s data loss risk on OS crash but 2-10x faster. | 1 | 1 (prod) 2 (perf) |
| innodb_flush_method Prevents double buffering. Standard recommendation on Linux. | fsync | O_DIRECT |
| innodb_doublewrite Prevents torn page corruption. Can disable on ZFS / Fusion-io. | ON | ON (prod) OFF (ZFS/Fusion) |
| innodb_log_files_in_group Deprecated in MySQL 8.0.30+ in favor of dynamic redo log. | 2 | 2 (MySQL 8.0) |
| PARAMETER | DEFAULT | RECOMMENDED |
|---|---|---|
| innodb_io_capacity Target background I/O ops/sec. Lower for HDD, higher for SSD. | 200 | 2000-20000 (SSD) |
| innodb_io_capacity_max Maximum background I/O ops/sec during heavy flush spikes. | 2000 | 4x io_capacity |
| innodb_read_io_threads Number of async read I/O threads. | 4 | 4-8 |
| innodb_write_io_threads Number of async write I/O threads. | 4 | 4-8 |
| innodb_purge_threads Background threads dedicated to undo log purge operations. | 4 | 4 |
| innodb_page_cleaners Number of dirty page cleaner threads. | 4 | = innodb_buffer_pool_instances |
| innodb_thread_concurrency 0=unlimited/auto. Tune to 2x CPU cores only under severe contention. | 0 | 0 (auto) |
| PARAMETER | DEFAULT |
|---|---|
| innodb_adaptive_hash_index Builds in-memory hash indexes for frequently accessed pages. Useful for OLTP. | ON |
| innodb_adaptive_hash_index_parts Number of AHI partitions to reduce contention (max 512). | 8 |
| innodb_change_buffering Buffers INSERT/DELETE/PURGE operations. 'all' is usually optimal. | all |
| innodb_change_buffer_max_size Maximum % of buffer pool allocated to change buffer (max 50). | 25 |
| innodb_stats_auto_recalc Automatically recalculates table statistics for query optimizer. | ON |
| innodb_stats_persistent Persists optimizer statistics on disk (survives restarts). | ON |