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!