Can't connect to MySQL server on '*.cluster-*.us-east-8.rds.amazonaws.com' error

0

Hi,

i have a python app that runs on a ec2 and connects to a RDS MySQL Database on an Aurora Instance (not Aurora serverless). It works if a small amount of users use it. But once like 20+ users hit it at the same time i get the error Can't connect to MySQL server on '*****.cluster-*******.us-east-8.rds.amazonaws.com' error.

I read that the max connections could be responsible for that. But from what i read that fully depends on the RAM of the RDS.

Therefore i tried upgrading from a t3 large to a r5 large. But that sadly did not make a difference.

BUT: My application is build in such a way that even when multiple users use it there is basically only the 1 single application making the calls to the database. And i read somewhere that there is also a second max connections per user variable that could be the cause of it. I sadly did not find where that is tho.

So my question in general is if someone maybe has experience with getting this error when they use the RDS too hard and what could potentialy be done to troubleshoot (to find the cause) and then of course fix it so it can handle a larger amount of users

1回答
0

Hello.

We recommend checking the RDS audit and error logs to troubleshoot connection counts.
I think it is also necessary to check whether there are any abnormal values ​​in "DatabaseConnections" in CloudWatch metrics.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.AuroraMonitoring.Metrics.html

If there is an abnormality in the number of connections, it may be improved by editing "max_connections" directly in the parameter group.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Managing.Performance.html

Also, if the number of connections is an issue, using RDS Proxy may be effective.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-proxy-planning.html

profile picture
エキスパート
回答済み 7ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ