What does this guide solve?
Memory and disk I/O are central to MySQL/InnoDB performance. Buffer pool, working set, redo logs, storage latency and indexing must be evaluated together.
Operating system
MySQL runs on Linux, Windows and other supported platforms. Linux is common in production because of packaging, automation and cloud/container ecosystems.
Windows remains valid for Windows-integrated applications; validate the exact platform support matrix.
Memory and InnoDB buffer pool
MySQL documentation commonly suggests roughly 50–75% of system memory as a starting range for InnoDB buffer pool on many dedicated-server scenarios, but connection buffers and OS needs must be considered.
Oversizing the buffer pool can cause swapping.
SSD/NVMe and I/O
Low-latency SSD/NVMe can materially improve disk-bound workloads. Monitor redo, data and temporary I/O patterns.
Safe controller cache, fsync behavior and cloud-disk IOPS limits belong in the design.
Security
Support for TLS 1.0/1.1 has been removed in modern MySQL releases; use current TLS and strong authentication plugins.
Restrict administrative accounts, apply least privilege to application users and do not expose the database port directly to the internet.
Replication and backup
Asynchronous replication can support read scaling and DR; Group Replication/InnoDB Cluster can be considered for HA.
Test logical and physical backup methods against workload size and restore objectives.
Frequently Asked Questions
What percentage of RAM should the InnoDB buffer pool use?
On dedicated systems 50–75% can be a common starting range, but the final value must account for connections, OS and other buffers.
Is SSD enough or is NVMe required?
SSD is sufficient for many workloads; NVMe helps where high IOPS and very low latency matter.
Does replication prevent data loss?
Not by itself. Replication is not backup and logical mistakes can replicate to secondaries.
Evaluate Your Database Infrastructure
We can review workload, security, hardware, HA and backup requirements together.
Architecture and operating model
InnoDB’s buffer pool caches data/indexes, redo supports recovery, and undo supports transaction/versioning operations. Binary logs and redo are distinct, requiring separate recovery/replication design. Size memory from working sets, connections and other services rather than a fixed percentage recipe.
- 1Connections/queries
- 2InnoDB cache and locks
- 3Redo/undo and data
- 4Binlog/backup/recovery
Design parameters
- Buffer pool and redo
- Measure working set, redo and checkpoint pressure separately; buffer pool must not consume all RAM.
- Durability settings
- Evaluate redo flush and binlog sync against power loss, replication and recovery goals.
- Workload and query mix
- Measure read/write ratio, connection count, transaction duration and expensive queries. Database size alone does not explain hardware needs.
- Memory and storage
- Examine working set, log writes, temporary space and checkpoint behavior separately. Reliable write guarantees matter alongside speed.
- Recovery chain
- Test recovery of the starting backup, required logs, configuration and keys together.
- Access and change
- Separate application, administrator and schema-change permissions. Control production index and parameter changes.
Worked example
Measure read-heavy and write-heavy periods separately. Correlate buffer-pool misses, log waits and running threads with query latency. Prove that binary-log retention supports the required PITR chain through a restore test.
Example commands: replace lab values and confirm permissions and software versions before use.
SHOW GLOBAL STATUS LIKE 'Threads_running';
Troubleshooting
| Observation | Likely cause / distinction | Verification |
|---|---|---|
| Commit latency rises | Log-flush I/O or locking may dominate. | Correlate transaction waits, redo writes and storage latency. |
| CPU is low but queries are slow | Locks, I/O or client waits may dominate. | Inspect the execution plan and wait type for the same query. |
| Replica is connected but stale | Sending, replay or transaction waits can create lag. | Compare the last applied operation with source commit time. |
| Storage keeps growing | Log retention, open transactions, replication slots or maintenance may be involved. | Inspect supported product statistics; do not delete logs manually. |
Acceptance checks
- Validate redo, binary logs and backups as distinct mechanisms.
- Test representative transactions and queries using realistic data distributions.
- Restore to a separate target and validate application records.
- Reject unauthorized reads and schema changes using a controlled identity.
- Verify one authorized writer and the correct connection target after failover.
- Measure locks, log volume and latency during maintenance.
Related concepts
Transaction boundary
A transaction groups operations that an application treats as jointly successful or failed. Database atomicity does not automatically include email delivery or changes in other services. Define the commit point and retry behavior. Evaluate idempotency to prevent processing the same request twice. Test connection loss before and after commit separately: a client-side error does not always mean the transaction failed.
Transaction logs and recovery chains
WAL, redo and transaction-log mechanisms record changes in order for durability and recovery, with product-specific details. Data copies and logs must belong to compatible timelines and chains. Having log files alone does not prove point-in-time recovery: a valid base backup and the required uninterrupted log range are also needed. Measure archival lag, log volume and replay time. Do not delete logs arbitrarily to regain space; use supported retention and cleanup methods.
Indexes and execution plans
An index can reduce scanned data for suitable queries, but adds write, maintenance and storage costs. Evaluate column order, selectivity, filters and sorting together. Slow queries are not always caused by missing indexes: estimates, locks, storage latency or excessive data transfer may dominate. Inspect representative execution plans and actual row counts. Measure read improvement alongside write overhead, and avoid uncontrolled production maintenance.
Locks, waits and deadlocks
Concurrent operations use locks or versioning to preserve integrity. Long transactions can block others; a deadlock forms a cycle of mutual waits. The database may terminate one participant, requiring safe application retries. Examine blocked and blocking queries together. Arbitrarily reducing isolation can change consistency guarantees. Test shorter transactions, consistent access order and suitable indexes under the same workload.
Durability and power loss
Survival of committed data depends on write guarantees across the database, OS, filesystem, controller and disks. Do not disable safety settings for speed without understanding caches and flush behavior. Power-loss-protected storage helps but does not prove correctness of the entire chain. Run failure and recovery tests in a controlled lab, not production. Validate application records and supported consistency checks rather than merely opening a sample file.
Replication scope
Replication transfers data or state changes to another copy. Synchronous transfer can introduce latency and connectivity dependence; asynchronous transfer can lag behind. A current replica is not necessarily protected from incorrect changes: deletion and corruption can propagate too. Compare lag with the application’s last committed operation, not merely connection status. Define which copy receives write authority after the source is lost and how the old node is reconciled when it returns. Report replication lag and the actual recoverable point separately.