5

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!

2 Answers 2

4

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!

1
  • 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, 2011 at 3:13
1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .