Performance Overview
Azure Database for MySQL provides a fully managed, high‑performance relational database service. This guide covers best practices for optimizing query performance, resource utilization, and scalability.
Key Performance Areas
Query Optimization
+
- Use
EXPLAINto analyze query execution plans. - Ensure appropriate indexes are in place.
- Avoid SELECT *
- Leverage prepared statements where possible.
Connection Management
+
Reuse connections via connection pooling. Limit max connections based on tier size to prevent resource exhaustion.
Resource Scaling
+
Scale compute and storage independently. Use the Scaling page for detailed steps.
Monitoring & Alerting
+
Enable Azure Monitor metrics: CPU, memory, IOPS, and query stats. Set up alerts for thresholds.
Performance Tools
- Query Performance Insight – Built‑in dashboard for slow queries.
- Azure Monitor – Custom dashboards and alerts.
- MySQL Tuning Primer – Run
mysqltuner.plagainst your instance.
Sample Configuration
# Example my.cnf adjustments for high‑throughput workloads
[mysqld]
innodb_buffer_pool_size = 75% # Adjust based on instance memory
innodb_log_file_size = 512M
max_connections = 200
query_cache_type = 0
query_cache_size = 0