DevOps

MySQL Config Tuner

Generate a my.cnf tuned for your hardware, covering the InnoDB buffer pool, log file sizing, flush method, connection handling and the settings whose defaults still assume a much smaller machine.

Last reviewed by the Radiatus Cloud team

Configuration appears here.

Want this automated for your stack?

We build CI/CD, Kubernetes & IaC pipelines that scale.

Talk to an engineer

The buffer pool is the setting that matters

InnoDB caches data and index pages in the buffer pool, and almost every other tuning decision is secondary to sizing it correctly. The default is 128 megabytes, which on a server with sixty four gigabytes means the database reads from disk constantly while the memory sits unused. The usual guidance is seventy to eighty percent of system memory on a dedicated database server, less where the application shares the machine. Getting this one line right typically outweighs every other change combined.

Redo log sizing controls write throughput

InnoDB writes changes to the redo log first and flushes dirty pages to the tablespace later. If the redo log is small, it fills quickly and forces aggressive flushing, which stalls writes. Historically this was innodb_log_file_size; MySQL 8.0.30 replaced it with innodb_redo_log_capacity, which is set as a single total. Sizing it to hold roughly an hour of writes gives InnoDB room to flush efficiently, at the cost of a longer crash recovery.

Durability is a deliberate trade

innodb_flush_log_at_trx_commit defaults to 1, which flushes and fsyncs the log on every commit and guarantees no committed transaction is lost. Setting it to 2 writes to the operating system on commit and fsyncs once a second, which is substantially faster and risks up to a second of committed transactions on a host crash, though not on a MySQL crash. That trade is correct for analytics and event data and wrong for anything financial, and it should be a decision rather than a default someone copied.

Related tools

Frequently Asked Questions

How large should the InnoDB buffer pool be?

About 70 to 80 percent of system memory on a dedicated database server, or the database size plus headroom if that is smaller. The default of 128 MB is sized for a machine that no longer exists and is the single most impactful thing to change.

What does innodb_flush_log_at_trx_commit do?

At 1 it flushes and fsyncs the redo log on every commit, guaranteeing durability. At 2 it writes on commit and fsyncs once a second, which is much faster and can lose up to a second of transactions if the host crashes, though not if only MySQL crashes. At 0 it can lose a second in either case.

Should I still set innodb_log_file_size?

On MySQL 8.0.30 and later it is replaced by innodb_redo_log_capacity, which sets the total across all files and can be changed without a restart. On MariaDB and older MySQL, innodb_log_file_size is still the setting.

Why is my query cache not helping?

The query cache was removed in MySQL 8.0 because it serialised access on a single mutex and became a bottleneck on multi core machines. MariaDB still has it and it is off by default for the same reason. Cache in the application instead.

How many connections should I allow?

Enough for your pools plus headroom, but each connection costs memory for its per session buffers. Above a few hundred, ProxySQL or a similar pooler multiplexes clients onto fewer server threads far more cheaply than raising max_connections.

Privacy & Security

Everything runs in your browser; nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Enter your server resources and workload to generate a tuned my.cnf.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.