1 Answer
- Newest
- Most votes
- Most comments
1
It seems there were a few factors contributing to the slow SELECT query performance on your Aurora MySQL serverless cluster:
The query was doing multiple FIND_IN_SET operations which can be expensive, especially if the tables are large and it has to examine a lot of rows.
At the same time, the writer was experiencing waits on redo log flushes, table locks and innodb hash table locks. This indicates the server was under heavy load and experiencing locking contention from concurrent DML operations.
You mentioned the cluster spiked and locked up, so the resources were likely overutilized as well. Aurora Serverless clusters are meant to auto scale but may not have been able to keep up with sudden spikes in load.
Some things you could try:
- Check CPU, memory and I/O metrics to identify resource bottlenecks
- Add indexes on columns used in WHERE, JOIN and ORDER BY clauses to avoid full table scans
- Rewrite the query using temporary tables or subqueries to avoid multiple FIND_IN_SET calls
- Increase the capacity settings if spikes are frequent to allow more headroom
Relevant content
- Accepted Answerasked 5 months ago
- asked 5 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago