There can be several reasons for this problem. Some reasons may be so obvious, but mention them for completeness. You said that queries are slow, so I assume the connection is successful and there are no problems with network ACLs, security groups, etc.
Reason 1. Your internet connection is too slow
This may be due to many reasons. See the following ...
- Another device using your internet bandwidth
- You have several concurrent downloads happening on your device
- Your internet quota has exceeded
- ISP Speed ββIssues
For some reason, this problem will be resolved after some time. Check your internet speed using this .
Reason 2. Exceeding the maximum number of connections in an RDS instance
You can set a limit on the maximum number of processes for MySQL. So, when you connect and run a command, then if the number of processes allowed to start is saturated, then you will have to wait and your request will be queued. But if you do not have a slot, then after that time out.
The total number of connections depends on the type of instance you are using. You can check and set this in the parameter of the group of database parameters. Look for max_connections .

Reason 3: geographic network delay
Your website in the same region has fewer network clicks to reach your RDS instance. But on your local machine, it may take several hops to get to RDS and get back. AWS usually works pretty fast and has a stable network, but you may notice latency issues for some protocols.
This is unlikely, but may still be the cause.
Reason 4. Low network bandwidth
To request multiple records, your bandwidth may not be enough to return them at an incredible rate. Therefore, you see the slowness of database queries.
Keet Sugathadasa
source share