- Newest
- Most votes
- Most comments
The significant increase in CPU usage after upgrading from MySQL 5.7 to MySQL 8.0 could be due to several factors:
-
Storage performance: The upgrade may have changed your storage configuration. If you were previously using magnetic volumes and switched to a small gp2 volume, this could cause performance issues. Consider modifying to gp3 volumes, which offer a baseline of 3000 IOPS, significantly higher than small gp2 volumes.
-
Query optimization: MySQL 8.0 may be executing queries differently than 5.7. Some queries that performed well in 5.7 might need optimization for 8.0. Use tools like EXPLAIN, SHOW PROFILE, and ANALYZE TABLE to identify and optimize problematic queries.
-
Index usage: Ensure proper index usage in the new version. MySQL 8.0 might be using indexes differently, leading to increased CPU load.
-
Configuration changes: Some default configuration settings may have changed between versions. Review and adjust your MySQL configuration parameters to optimize for your workload.
-
Increased concurrency: If there's a sudden increase in concurrent connections or transactions, it could lead to CPU contention.
To troubleshoot:
- Use Performance Insights or similar tools to identify the top CPU-consuming SQL queries.
- Check if there are any long-running transactions or analytic queries causing the issue.
- Monitor other metrics like memory usage, I/O wait, and network throughput to get a complete picture.
- Consider using Enhanced Monitoring for more granular metrics with 1-second intervals.
- If the high CPU usage persists and can't be optimized, you may need to scale up your instance to handle the increased load.
Remember to test any changes in a non-production environment before applying them to your production system.
Sources
Upgrade from MySQL 5.7 to MySQL 8.0.35 causing huge performance problems | AWS re:Post
cpu - Amazon Aurora
Troubleshooting workload issues for Aurora MySQL databases - Amazon Aurora
answered 2 years ago
Relevant content
asked 2 years ago
asked 3 years ago
