
A large number of in-memory temporary tables can quickly lead to low available memory in an instance of Azure Database for MySQL. In production systems with many sessions performing compilations of large temporary result sets, you should regularly check the global status counter created_tmp_tables, which tracks the number of temporary tables being created during peak hours. Since any temporary tables created are local to a session, different sessions can have different temporary tables. Temporary tables can be reused several times during a session. MySQL uses “temporary tables”, which are a special type of table designed to store a temporary result set. These causes are dependent on the characteristics of the workload.

Let’s look at some more causes of high memory utilization in MySQL. As a result, a surge in database connections can cause memory shortages. It’s important to note that each connection established with the database server requires the allocation of some amount of memory. If you notice that memory utilization has suddenly increased and that available memory is dropping quickly, monitor other metrics, such as Host CPU Percent, Total Connections, and IO Percent, to determine if a sudden spike in the workload is the source of the issue. To better understand the memory utilization for your database server, view the Host Memory Percent or Memory Percent metrics. Monitoring memory usageĪzure Database for MySQL provides a range of metrics to gauge the performance of your database instance. A larger buffer pool requires fewer I/O operations being diverted to the disk. MySQL tries to accommodate as much table and index-related data in the buffer pool as possible. The value of the innodb_buffer_pool_size parameter specifies the area of memory in which InnoDB caches the database tables and index-related data.

By default, when you create an instance of Azure Database for MySQL, the available physical memory is dependent on the tier and size you select for your workload. To help ensure that a MySQL database server performs optimally, it's very important to have the appropriate memory allocation and utilization.

Azure Database for MySQL - Flexible Server
