Sample Header Ad - 728x90

Why does MySql in AWS RDS have periodic "Connect Timeout expired" errors?

0 votes
1 answer
139 views
This one is bizarre because the database itself is never under any significant load...logs show CPU usage averaging around 5-10%, Memory usage is low, 10-20%, there's only ever 20 or so connections max per day usually, there's no errors in the logs, no IO blocking or anything obvious that could account for it. Moreover, this is not an issue where it is failing on a big expensive query or ETL or something, it's random and it occurs during the initial connection phase from the client. We have a job that runs nightly at 2AM, it alternates days working vs failing. So Mon-Wed-Fri this week it ran fine but Sun-Tue-Thu it failed. And it fails on the very first query in the job where it is simply doing a SELECT * FROM Company; (where the Company table has about 500 rows), every 2nd day it times out, every other day it works fine. There is a nightly backup setup in RDS but that runs at 6AM so it's not related to that I also periodically get timeouts myself while testing/debugging during the day, its random and if I just wait a minute and try again there's no issue. Its a really insidious bug that I can't make heads or tails of. Any suggestions or ideas what might be going on? This is MySql 8.0.35 on AWS RDS on an db.t4g.medium instance (2 vCPUs, 4GB RAM, Network up to 2085 Mbps)
Asked by snappymcsnap (103 rep)
Mar 28, 2025, 02:07 PM
Last activity: Mar 28, 2025, 11:15 PM