Incident Library

IL-0435 CyberAgent · 2026-04-02 (published)databaseawskubernetes

Error rates rose as Aurora MySQL killed connections and declined queries to avoid OOM while load metrics stayed flat

CyberAgent's Service Reliability Group traced an error rate alert to Aurora MySQL 3.04 avoiding OOM by killing connections and declining queries. FreeableMemory had been falling since a feature release while CPU, active sessions, slow queries, query counts and connection counts were unchanged. An ANDPAD article described Performance Schema lowering FreeableMemory after an upgrade from Aurora MySQL 3.04 (MySQL 8.0.28) to 3.10 (MySQL 8.0.42) changed default behaviour on some instances. This environment was on 3.04, so the case was not the same, but it pointed at Performance Schema.

Performance Schema as a whole was using about 5.2GB, with current use equal to the peak, so it was still growing. The largest consumers were the per-host and per-account summaries. There were about 16,000 hosts and about 16,000 accounts, and the accounts were filled with distinct source hosts recorded under different IP addresses. The release had added a per-minute Kubernetes CronJob whose short-lived pods connected from a new pod IP each time, so hosts and accounts, and the summaries kept for each, grew without end. FreeableMemory kept falling, SwapUsage rose, and finally Aurora's OOM avoidance killed queries.

The fix was in the Aurora MySQL parameter group: performance_schema changed from 0 (automatic management) to 1 (manual management), and two related parameters whose default is -1 (unlimited) were capped at 100. The new values take effect only after the RDS instance is restarted. After the change FreeableMemory stopped falling and swap use stopped.

Severity
–
Scope
Application requests failed and slowed while Aurora MySQL killed connections and declined queries
Users affected
–
Region
–
Time to detect
–
Time to resolve
–

Symptoms

An alert fired one day because an application's error rate had suddenly risen. The error log of the Aurora MySQL RDS instance for that time showed Aurora killing connections and declining queries to avoid running out of memory. The killed queries also made application latency worse.

FreeableMemory had been falling steadily since one particular day, and SwapUsage rose some time later. Nothing else pointed at database load: CPU utilisation showed no large change over a month, average active sessions in Database Insight had not worsened over the last week, there were no slow query log entries, and query counts and connection counts showed no change in trend. The day FreeableMemory started to fall was the day of a new application feature release.

Symptom High error rateMemory pressure

Root cause

Trigger
An application release added a batch job run every minute by a Kubernetes CronJob. Each run's short-lived pod connected to the database from a new pod IP.

Detection

An alert fired on the application's error rate.

Remediation

Action items

–

Lessons

When system alerts fire but the database's load metrics look calm, Performance Schema growth is worth suspecting. The two parameters that were capped are unlimited by default, so connections from ever-changing source addresses keep adding to the records. Capping them has a cost: once the cap is exceeded, per-host figures in Performance Insights are missing. Putting RDS Proxy between the application and Aurora MySQL to keep source hosts stable is another possible measure.

Sources

References

Related cases

Check your cluster for this

kubegap audits a Kubernetes cluster for conditions like the ones in this case, Database, Jobs and CronJobs among them, read-only, from Claude Code or Codex. Its checks cite public reports like this one.

For AI tools and scripts

The API needs no key. The MCP server offers search_incidents, get_incident, list_incidents, get_topic and vocab; both are explained on API and MCP.