Skip to main content

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.

Verification Protocol

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 iowait bottlenecks.
  • Calculate the innodb_buffer_pool_size exactly matching 60-70% of available RAM (on dedicated database servers) or 40-50% (on shared web/database nodes).
  • Confirm innodb_flush_method maps to O_DIRECT.
  • Determine max_connections aligns logically against your maximum PHP worker capacity.
  • Verify query_cache_type rests forcefully at 0 (Disabled).
  • Deploy the Slow Query Log actively utilizing a strict long_query_time = 1 threshold logic.

Table and Query Architecture

Mapping internal metadata correctly to prevent full table logic scans.

Parameter CheckpointSuccess CriteriaFailure Mitigation
Query Total CountsThe 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 VarianceNo 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 LimitThe 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\G and review BUFFER POOL AND MEMORY and any deadlock sections.
  • Watch the Threads_connected variable during standard business hours. It must comfortably sit below 70% of your declared max_connections ceiling natively.
  • Engage the iostat tracker while a massive site backup runs smoothly, ensuring %iowait barely registers across the SSD grid.

Object Cache Integration

Providing the application explicit permission to bypass MySQL completely.

Parameter CheckpointSuccess CriteriaFailure Mitigation
Redis Connectivitywp 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 BehaviorCache 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 PolicyThe 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.

What's Next