Get online today — Domain + Hosting at discounted prices View Combo Offers ›

MySQL / MariaDB Config Tuner

Generate an optimized MySQL/MariaDB my.cnf file based on your server RAM.

Use this tool to instantly calculate the mathematically optimal memory settings for your MySQL or MariaDB database server. Simply input your server's total RAM, and the tool will generate a perfectly tuned my.cnf configuration block.

Out of the box, MySQL is configured for extremely low-end legacy hardware (to ensure it runs on literally anything). If you install MySQL on a modern 16GB VPS without modifying the configuration, it will only use a tiny fraction of the available memory, resulting in terrible performance and high disk I/O bottlenecks.

How it works

Database performance is entirely dictated by how much data can be kept in ultra-fast RAM rather than being read from a slow SSD or hard drive.

InnoDB Buffer Pool: The most critical setting in MySQL is the innodb_buffer_pool_size. This dictates how much RAM is dedicated to caching database tables and indexes. A widely accepted best practice is to allocate roughly 50% to 70% of your total server RAM to this pool (assuming it is a dedicated database server). If you also run a web server (like Apache or Nginx) on the exact same machine, you must lower this to 20%-30% to prevent the server from crashing due to Out Of Memory (OOM) errors.

Thread Caching & Connections: The tool also calculates optimal connection limits (max_connections) and thread cache sizes based on your total memory, ensuring that traffic spikes do not overwhelm the server's CPU.

Deployment: Once generated, you should paste these settings under the [mysqld] block in your configuration file (usually located at /etc/mysql/my.cnf or /etc/my.cnf) and restart the database service.

Frequently asked questions

Will this stop MySQL from crashing randomly?

Yes. The #1 cause of MySQL crashing (and shutting down silently) is the Linux kernel OOM (Out of Memory) Killer terminating the process because the server ran out of RAM. If you select "Shared Server" in this tool, it ensures MySQL leaves enough free memory for Apache and PHP to function without triggering the OOM Killer.

Is this for MySQL or MariaDB?

Both. MariaDB is a highly compatible drop-in replacement fork of MySQL. The core InnoDB memory settings generated by this tool apply equally to both database engines.

What is the InnoDB Log File Size?

The `innodb_log_file_size` dictates how much transaction history is kept in memory before being flushed to disk. A larger log file improves write performance (INSERTs and UPDATEs) significantly, but increases the time it takes for MySQL to recover after a hard crash.

Can I just set max_connections to 10,000?

No. Every single open connection requires its own dedicated RAM allocation for sorting and joining operations. If you set `max_connections` artificially high and actually receive that much traffic, your server will immediately run out of memory and crash. It is better to have connections queue up than to crash the entire server.

Related tools

Need hosting that just works?

Free SSL, daily backups and 24×7 support on every Loudhost plan.

View Hosting Plans