- Newest
- Most votes
- Most comments
Based on the symptoms you've described—particularly the transition from high iowait to 99% system CPU, followed by mysqld disappearing without an OS reboot—this pattern suggests a critical resource contention issue that escalated to a point where the MySQL process became unresponsive or was terminated by an internal mechanism.
Addressing your specific questions:
-
High iowait transitioning to 99% system CPU: This progression typically indicates that the system initially experienced storage I/O bottlenecks (the 61.7% iowait), which then cascaded into kernel-level resource contention. When I/O operations queue up extensively, the kernel spends increasing amounts of time managing these operations, context switching between processes, and handling resource allocation—all of which consume system CPU rather than user CPU. The fact that user CPU remained under 1% while system CPU hit 99% strongly suggests the kernel was overwhelmed managing resources rather than executing normal database queries.
-
Potential root causes: Given your symptoms, the most likely scenarios are:
- Memory pressure leading to excessive paging/swapping attempts: Even though swap was disabled and you saw no swap usage, severe memory pressure can cause the kernel to spend enormous amounts of system CPU attempting memory management, scanning for reclaimable pages, and handling out-of-memory conditions.
- Storage subsystem issues: Problems with the underlying EBS volumes or storage network could cause I/O operations to stall, leading to kernel threads consuming CPU while waiting for storage operations to complete or timeout.
- Resource contention from excessive connections: A connection storm or sudden spike in concurrent connections can cause the kernel to spend significant CPU on context switching and connection management, especially when combined with memory pressure.
-
mysqld disappearing without OS reboot: When mysqld vanishes from the process list while OS uptime continues normally, this indicates the process was terminated rather than the system rebooting. Possible mechanisms include:
- An internal RDS watchdog detecting an unresponsive database process
- The Linux OOM (out-of-memory) killer terminating mysqld due to memory exhaustion, even if you didn't capture direct evidence
- MySQL itself crashing due to an internal error or resource exhaustion
- RDS infrastructure management terminating an unhealthy process
-
Why Stop/Start provided sustained stability: Stop/Start reprovisioning the underlying compute instance likely resolved the issue because it:
- Allocated fresh underlying hardware, potentially moving away from a problematic host
- Cleared any kernel-level resource leaks or stuck states
- Reset all system-level caches and buffers
- Provided a completely clean slate for memory management
Simple reboots restart the MySQL process but maintain the same underlying infrastructure, so if there was a host-level issue (such as degraded storage performance or kernel problems), reboots wouldn't resolve it.
-
Determining termination cause: Without a paid support plan, your best diagnostic approach is:
- Check the MySQL error log for crash signatures, assertion failures, or out-of-memory messages immediately before the restart
- Review Enhanced Monitoring data for memory metrics (particularly
memory.free,memory.cached,memory.buffers) leading up to the incident - Look for patterns in process counts and memory consumption per process
- Check RDS Events in the console for any automated actions taken by RDS
- Examine CloudWatch metrics for
DatabaseConnectionsspikes that might indicate a connection storm
-
Instance class modification contribution: The automated scaling at 06:30, two hours before the incident, is unlikely to be the direct cause since the instance operated normally during that interval. However, if the workload pattern changed after the scaling (for example, batch jobs or reporting queries that only run during business hours), the smaller instance class might have been insufficient for the actual workload, leading to progressive resource exhaustion.
-
Additional metrics to preserve:
- Database-level metrics: active connections over time, query throughput, transaction rates
- Enhanced Monitoring: detailed per-process memory consumption, disk I/O queue depths, network statistics
- Performance Insights data showing top SQL statements and their resource consumption (CPU, I/O, locks) during the incident window
- MySQL slow query log if enabled
- Any application-level metrics showing query patterns or connection pool behavior
Recommended preventive actions:
-
Monitor resource usage proactively: Set up CloudWatch alarms for CPU utilization, memory, and I/O metrics that trigger before reaching critical thresholds. This allows you to detect resource contention before it becomes severe.
-
Use Performance Insights: Enable and regularly review Performance Insights to identify resource-intensive queries. The database load chart can help you understand which queries are consuming the most CPU, I/O, or memory resources.
-
Optimize your workload: Review your application's database usage patterns, especially around the time the incident occurred. Look for:
- Long-running or inefficient queries that could be optimized
- Sudden increases in connection counts
- Batch operations or reporting queries that might overwhelm the instance
- Missing indexes or suboptimal query execution plans
-
Consider instance sizing: If your workload consistently consumes high amounts of resources during business hours, the db.m6g.xlarge instance may be undersized. Consider either maintaining a larger instance class during peak hours or optimizing queries to reduce resource consumption.
-
Review connection management: Ensure your application properly manages database connections, uses connection pooling effectively, and doesn't create connection storms during startup or failover scenarios.
The combination of high system CPU, I/O wait, and process termination followed by sustained stability after Stop/Start strongly suggests either a host-level infrastructure issue or severe resource exhaustion that required complete reprovisioning to resolve. Implementing proactive monitoring and workload optimization should help prevent recurrence.
Sources
Troubleshoot restarts and failovers in Amazon Aurora | AWS re:Post
cpu - Amazon Aurora
CPU - Amazon Relational Database Service
answered a month ago
It fits one pattern closely: memory exhaustion on a system with no swap. Below is why, and how to confirm it with free tools.
The most likely chain of events
- Free memory runs out. FreeableMemory was already low, and swap is 0.
- The kernel starts thrashing page cache. With no swap, it can only free memory by dropping file-backed pages: the page cache, and the
mysqldbinary and library code pages. Those pages are needed immediately and get read back from EBS. That matches iowait rising from 13% to 62% at 08:26–08:27. - The kernel spends almost all its time on memory reclaim. Direct reclaim and compaction run in kernel mode, which gives ~99% system CPU with ~0.7% user CPU. MySQL makes almost no progress, so network traffic drops and Apache uses up all 200 workers.
mysqldis killed while the OS stays up. This is the OOM killer or RDS's own health monitoring.mysqldholds most of the memory, so killing it frees it at once. That matches the sharp memory drop at 08:33:25, while OS uptime keeps counting.- RDS restarts
mysqldin place. "Server - start" at 08:33:43 and "ready for connections" at 08:36:03, which included crash recovery.
Answers to your questions
Why iowait first, then system CPU? This sequence is typical of memory pressure without swap: first heavy page-cache re-reads, then reclaim taking over the CPU. A storage failure alone would normally keep iowait high, not turn into nearly 100% system CPU.
Why does mysqld restart without an OS reboot? An OOM kill or a forced restart by RDS stops only the process. The OS keeps running, so uptime keeps counting. No RebootDBInstance call appears in CloudTrail because no API call was made.
Why did reboots only help briefly while Stop/Start held? After a reboot, the same instance class and the same load quickly push memory back to the limit. The buffer pool reloads, and 200 Apache workers reconnect. Stop/Start's lasting effect has two possible explanations:
- The time of day. You change the instance class three times a day. Check whether the midday change moved you to a larger class after the Stop/Start. If it did, that, not the Stop/Start, is the likely reason the afternoon was stable.
- A host problem. Stop/Start can place the instance on different hardware. Only AWS can confirm whether that happened.
Did the 06:30 class change contribute? Very likely. An OS uptime of about 2:02 at 08:32 means the OS started at about 06:30, which was the class change. The change set the amount of memory the instance had, and the morning load ramp then exceeded it. Check two things:
- Are memory parameters set to fixed values sized for your larger daytime class? A fixed
innodb_buffer_pool_sizethat doesn't use the{DBInstanceClassMemory*3/4}formula would take a much larger share of 16 GiB on db.m6g.xlarge. - How much memory each connection can use. Up to 200+ connections × (
sort_buffer_size,join_buffer_size,read_buffer_size, temp tables), plustemptable_max_ram(1 GiB by default) and performance_schema.
Confirming the cause with free tools
- RDS Events for the instance. In the console under Events, or with
aws rds describe-events --source-type db-instance --duration 1440. RDS often records why it restarted the database, sometimes mentioning memory. Events are kept for only 14 days, so export them now. - The MySQL error log just before 08:33:43:
- No shutdown messages, followed by InnoDB crash recovery, means the process was killed. SIGKILL from the OOM killer leaves no log entry of its own.
- A stack trace with "mysqld got signal 11/6" means
mysqldcrashed. - Normal shutdown messages mean a controlled restart.
- Enhanced Monitoring JSON from 08:20 to 08:33:
memory.free,memory.cached,memory.active/inactive. Cached memory dropping toward zero is strong evidence of thrashing.diskIOread IOPS on the data volume rising sharply while cached memory falls.processList: memory used bymysqld, and whether any other process is growing.
- Database Insights: top wait events and DB load during the ramp, and whether connections or temp-table activity rose.
- Directly in MySQL, ongoing:
SHOW GLOBAL STATUS LIKE 'Max_used_connections', andSELECT * FROM sys.memory_global_by_current_bytes LIMIT 20after the morning ramp, to see where memory goes.
Preventing a repeat
- Keep enough memory headroom after the 06:30 downsize. Use the formula-based buffer pool setting, cap
max_connectionsat a level the smaller class can support, and lower the per-connection buffers. - Reduce the number of connections. Prefork with 200 workers can open 200 database connections. RDS Proxy or a smaller worker or connection pool cuts per-connection memory a lot.
- Alarm on FreeableMemory well above zero, sized to each instance class, so the next occurrence is caught before thrashing.
- Reconsider the morning class, or move the downsize to after the morning peak. A memory-optimized class such as db.r6g/r7g at the same vCPU count gives twice the memory.
If the error log shows a real mysqld crash with a stack trace, or memory and cached memory weren't low before the incident, the memory explanation doesn't fit. In that case, send the Enhanced Monitoring JSON and error-log extracts to AWS so they can check the host.
Relevant content
asked 3 years ago
asked 3 years ago
asked 3 years ago
