I'm running a site on AWS with the following setup:

  1. Single m1.small instance (web server)
  2. Single RDS m1.small db
  3. Joomla 1.5

Generally, the site is performant, but is fairly low-traffic - say around 50-100 visits / hour. However, at peak time, we see about double that traffic. During peak time, pretty much every day:

  1. CPU usage on the web server slowly climbs to 100%
  2. CPU usage on the RDS server climbs quite quickly to about 30%, from an average of about 15
  3. Database connections shoot up to about 140, from a normal average of about 2 or 3

The site is then occasionally unreachable, certainly according to pingdom monitoring.

Does anyone recognise this behaviour? Can you point me in the right direction to begin investigating? Of course, RDS makes it difficult to do things like slow query logging, so I've started by regularly dumping the mysql process list into a file to see if there's anything I can spot there, but it would be good to have something more concrete to investigate.


At least, can someone confirm that I'm definitely right in saying that the level of traffic implies the problem must be a specific type of query taking way longer than it should to execute? This would happen if a table gets locked, and many queries need to write to it, right? For this very reason, I've already changed the __session table type to InnoDB.


Rather than dumping queries, you can enable slow query logging using RDS DB Parameter Groups. RDS saves slow queries in table mysql.slow_log. Here is a helpful thread.

To boost the performance, use some caching mechanism like Joomla System Cache plugin.

There might not be issue with MySQL. You also need to consider other things like images size and number of images being served from web server, performance of extensions being used with Joomla.

  • Thanks. Slow query logging is my next step - I found that thread yesterday. Having read a lot of older aws forum threads that said there was no access to the slow log, I was looking fro an alternative, so it was good to find out that slow logging is an option. I'm curious as to why you think that images being served might play a part in this - why would image requests cause a large number of db connections?
    – Bobby Jack
    Jun 28 '12 at 9:20
  • Images will not create problems for database but it looks like a potential problem for web server as you mentioned in point 1. This is not a definite problem, it may increase web server load. Use slow query logging with care, enable it for small interval. This also increases the load of RDS as it logs queries in database. Did you consider using caching?
    – Wasif
    Jun 28 '12 at 18:45
  • I'm already caching at the module level. Caching at the page level is not an option because most of our traffic is logged in users and content is access controlled. I have my suspicions of the culprits (a stats component that writes heavily to the db, and a sef component that makes a db call per link on a page) but want to confirm those suspicions before taking drastic action
    – Bobby Jack
    Jun 28 '12 at 21:34

I don't think this is a MySQL issue. What you describe is what I've experienced on Joomla websites when the memory allocation for the instance (slice) isn't sufficient. I suggest increasing the memory allocation and then monitor the results for improvement.

If you still think this is a MySQL issue, I would create a dummy application using MySQL and do load testing on it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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