Upgrading managed database engines should be routine. But sometimes, subtle configuration changes can lead to unexpected performance regressions. Recently, a case with Amazon Aurora MySQL 3.08.2 (based on MySQL 8.0.39) highlighted how a small change in Performance Insights and Performance Schema behavior can mimic a memory leak — especially on smaller instance classes.
In this article, I’ll walk through the symptoms, root cause, and what developers can do to fix it.
The Symptoms: Memory Leak–Like Behavior
Memory Leak–Like Behavior After upgrading an Aurora cluster from 3.05.2 → 3.08.2, a customer observed that their writer instance steadily ran out of memory.
Key facts:
- Instance type:
db.t4g.medium(4 GB memory) - Freeable memory dropped continuously post-upgrade.
- Workload load was modest and unchanged.
To the untrained eye, this looked like a classic memory leak — but the actual cause was different.
Root Cause: Performance Schema Behavior Changed
Prior to 3.08.2, on t4g.medium instances with Performance Insights enabled, the Performance Schema was disabled by default. This was a documented limitation:
“Automatic management of the Performance Schema isn’t supported for the t4g.medium instance class.”
After the upgrade to 3.08.2, this behavior changed: Performance Schema was enabled and managed by Performance Insights. This caused Performance Schema tables (in-memory only) to populate. Result: A gradual depletion of available memory, mimicking a memory leak.
You can confirm this by running:
SHOW GLOBAL VARIABLES LIKE 'performance_schema';
SELECT * FROM sys.memory_global_by_current_bytes LIMIT 10;
Solutions
You have two main fixes:
1. Disable Performance Schema
If you don’t need it: Set performance_schema=0 in the parameter group. Requires a reboot.
2. Scale Up Your Instance
If you rely on Performance Schema:
Move from t4g.medium to a larger class (e.g., db.r6g.large). Ensures enough headroom for workload + schema tables.
Lessons Learned
- Not all memory drains are leaks. Sometimes it’s instrumentation overhead.
- Aurora upgrades can change defaults. Validate after every upgrade.
- Small instance classes + Performance Schema = trouble.
Final Thoughts
If you’ve recently upgraded Aurora MySQL to 3.08.2 and noticed what looks like a memory leak on your writer, check whether performance_schema was silently enabled. Disable it if unnecessary. Scale up if you need it.
The problem wasn’t your workload — it was the defaults.
Leave a Reply