Database Tuning Checklist
Database tuning is easiest when you validate fundamentals in a consistent order: memory (buffer pool), connections, slow query visibility, and only then targeted indexes. Use this checklist after migrations, before campaigns, or when you suspect database regressions.
Utilize this checklist immediately following a server migration, prior to launching massive marketing campaigns, or whenever an established WordPress site repeatedly generates an Error Establishing Database Connection warning during routine dashboard navigation.
Engine Configuration and Hardware
Validate the foundation parameters that prevent slow I/O and OOM events.
- Ensure the storage subsystem relies exclusively on high-speed NVMe storage drives to strictly eliminate
iowaitbottlenecks. - Calculate the
innodb_buffer_pool_sizeexactly matching60-70%of available RAM (on dedicated database servers) or40-50%(on shared web/database nodes). - Confirm
innodb_flush_methodmaps toO_DIRECT. - Determine
max_connectionsaligns logically against your maximum PHP worker capacity. - Verify
query_cache_typerests forcefully at0(Disabled). - Deploy the Slow Query Log actively utilizing a strict
long_query_time = 1threshold logic.
Table and Query Architecture
Mapping internal metadata correctly to prevent full table logic scans.
| Parameter Checkpoint | Success Criteria | Failure Mitigation |
|---|---|---|
| Query Total Counts | The database processes fewer than 100 queries per rendered uncached page load (measured via Query Monitor). | Debug the theme codebase or prune poorly constructed plugins attempting extreme data aggregation. |
| Execution Variance | No single query registers inside the slow_query_log utilizing over 1.0 seconds of CPU execution. | Map custom composite indexes on wp_postmeta specifically targeting the exact problem plugin. |
| Autoload Limit | The total combined size of the wp_options table carrying autoload = 'yes' evaluates significantly under 1.5MB total size. | Locate massive JSON metadata arrays saved inside the options table, explicitly flipping their autoload value mapping to no. |
Runtime Diagnostics
Tracking the continuous health metrics monitoring active threads.
- Run
SHOW ENGINE INNODB STATUS\Gand reviewBUFFER POOL AND MEMORYand any deadlock sections. - Watch the
Threads_connectedvariable during standard business hours. It must comfortably sit below70%of your declaredmax_connectionsceiling natively. - Engage the
iostattracker while a massive site backup runs smoothly, ensuring%iowaitbarely registers across the SSD grid.
Object Cache Integration
Providing the application explicit permission to bypass MySQL completely.
| Parameter Checkpoint | Success Criteria | Failure Mitigation |
|---|---|---|
| Redis Connectivity | wp cache get test_key immediately demonstrates exact cache connectivity seamlessly via WP-CLI. | Ensure the object-cache.php drop-in accurately resides inside the standard /wp-content/ directory. |
| Hit/Miss Behavior | Cache hits increase on repeat dynamic requests (admin, logged-in, checkout) without breaking functionality. | Verify the object cache drop-in, check Redis memory limits, and confirm the cache is not being bypassed. |
| Memory Policy | The Redis server safely leverages the allkeys-lru eviction algorithm strictly. | You mapped a rigid memory limit without the LRU instruction natively, completely crashing Redis upon memory exhaustion. |