Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a site hosted on AWS EC2 (Elastic Beanstalk), with a MySQL database hosted on AWS RDS. Everything works fine on the production server, fast and all.

However when I try to connect remotely from my local machine, it sometimes gets extremely slow (like 4 minutes to load the list of tables), or simply times out.

I added my IP in the security group (which I did correctly, since it sometimes works). When it doesn't work, I at the same time check the prod server and it still looks good.

share|improve this question

1 Answer 1

As much I could understand, there is nothing wrong at the ACL or network level, as you are saying that it works sometimes.

What I can see is that you are hitting a limit on the maximum number of processes for Mysql. So, when you connect and issue any command, then if the number of processes allowed to run are saturated, then you have to wait and your request goes into queue. But if you don't get a slot then after that it timeouts.

You can check the same by looking at the graphs which are available with RDS. If the graph is going flat at some value, then my guess is very right.

The total number of connections depends on the instance type you are using. That you can check and set in the DB parameters group option. Search for max_connections.

I am not sure what are the default values for different types of instances, but I am sure this information should be somewhere over the internet.

share|improve this answer
    
Is there a different max_connections for local connections vs external connections? I'm saying this because the web server never has this issue when connecting from the EC2. Only from remote... –  nute Dec 27 '12 at 7:53
    
Not really, but there is one more parameter, max_user_connection. Though I don't believe that it should affect, but you might take a look at that. –  GeekRide Dec 27 '12 at 8:09
    
max_connections = {DBInstanceClassMemory/12582880} and max_user_connection is not set. Right this minute I can't access remotely at all while on the site it works fine. Also there is virtually no one on the site - so hard to believe I've reached the max... –  nute Dec 30 '12 at 14:23
    
Hmm. Not sure then. Can't think of anything as of now. Will surely update if I hit something like this. –  GeekRide Dec 30 '12 at 17:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.