Best practices for monitoring Azure Database for MySQL - Flexible Server
Learn about the best practices that can be used to monitor your database operations and ensure that the performance isn't compromised as data size grows. As we add new capabilities to the platform, we'll continue to refine the best practices detailed in this section.
Layout of the current monitoring toolkit
Azure Database for MySQL flexible server provides tools and methods you can use to monitor usage easily, add, or remove resources (such as CPU, memory, or I/O), troubleshoot potential problems, and help improve the performance of a database. You can monitor performance metrics regularly to see the average, maximum, and minimum values for various time ranges.
You can set up alerts for a metric threshold, so you're informed if the server has reached those limits and take appropriate actions.
Monitor the database server to make sure that the resources assigned to the database can handle the application workload. If the database is hitting resource limits, consider:
- Identifying and optimizing the top resource-consuming queries.
- Adding more resources by upgrading the service tier.
CPU utilization
Monitor CPU usage and if the database is exhausting CPU resources. If CPU usage is 90% or more, than you should scale up your compute by increasing the number of vCores or scale to next pricing tier. Make sure that the throughput or concurrency is as expected as you scale up/down the CPU.
Memory
The amount of memory available for the Azure Database for MySQL flexible server database server is proportional to the number of vCores. Make sure the memory is enough for the workload. Load test your application to verify the memory is sufficient for read and write operations. If the database memory consumption frequently grows beyond a defined threshold, this indicates that you should upgrade your instance by increasing vCores or higher performance tier. Use Query Store, Query Performance Recommendations to identify queries with the longest duration, most executed. Explore opportunities to optimize.
Storage
The amount of storage provisioned for Azure Database for MySQL flexible server determines the IOPs for your server. The storage used by the service includes the database files, transaction logs, the server logs and backup snapshots. Ensure that the consumed disk space doesn't constantly exceed above 85 percent of the total provisioned disk space. If that is the case, you need to delete or archive data from the database server to free up some space.
Network traffic
Network Receive Throughput, Network Transmit Throughput – The rate of network traffic to and from the Azure Database for MySQL flexible server instance in megabytes per second. You need to evaluate the throughput requirement for Azure Database for MySQL flexible server and constantly monitor the traffic if throughput is lower than expected.
Database connections
Database Connections – The number of client sessions that are connected to the Azure Database for MySQL flexible server instance should be aligned with the connection limits for the selected SKU size.