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

I'm doing some load/stress testing on a PHP web application that is backed by a Small RDS database instance. When I hit the website with ~50 concurrent web requests, the RDS database just stops responding to all connection requests for about 10 seconds (both from my web application, and from me using the command line mysql client from other machines). PHP gives the following error:

Could not connect to database. Lost connection to MySQL server at 'reading initial communication packet', system error: 110

I assumed this was just poor/slow SQL in the web application that was hogging resources, but this performance seems really bad, so I dug a little deeper. I setup another mysql server on an EC2 micro instance with the same version of mysql, a clone of the database, and a default configuration. The EC2 instance performs several times better (both latency, and # of concurrent web requests before croaking).

My RDS instance and my EC2 instance are using the same version of mysql, with default configurations, although I've tried tweaking the RDS instance to increase various buffers, max_connections, and max_connection_errors, all to no avail.

What gives? Why would an RDS instance with better "disk" I/O, 3x RAM, and more dedicated CPU be outperformed by a wimpy EC2 instance?

My suspicion is that this is either an AWS quirk or a MySQL/RDS configuration issue - hoping that a guru on either subject can shine light on the issue... Thanks!

share|improve this question

2 Answers 2

One of the things that we ran into with a small RDS instance was the # of connections setting. It's a formula based on RAM - and it only allows ~ 150 connections on a small DB. That's the first thing that I would look at.

SHOW PROCESSLIST;

would be the command. If you are not using some sort of connection pooling in your app, I could see hitting that limit fairly quickly.

Just a shot in the dark, but good luck anyways!

share|improve this answer
    
As I mentioned, I increased the max_connections settings and it didn't seem to do anything. SHOW PROCESSLIST shows one process running indefinitely. –  Stefan Sep 19 '11 at 3:13

You need to create a "DB Parameter Group" and then use the command line tools to edit the setting: AWS RDS Deployment Guide.

share|improve this answer

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.