AWS RDS painfully slow when connected from a local machine

I have an AWS RDS instance and it works. When a database is requested from my site (also on AWS, in the same region), it works beautifully. But if I try to connect to the database from my local development machine, AGES is required for any request. Does anyone know why? I opened a security group to connect (while I try to connect from the local machine).

+14
amazon-web-services amazon-rds
source share
2 answers

Looks like there is a problem with your internet connection? All requests from your local workstation must come from your home or office network, the Internet, and then to AWS VPC. If you have a slow internet connection, this will be a problem. There may also be a problem with any local firewall in your home / office.

0
source share

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 .

enter image description here

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.

0
source share

All Articles