I stopped by DeathCabForCutie.com today to see if they had any tour dates. After trying to click on the blog the website turned into a pile of steaming MySQL failure!
Warning: mysql_connect() [function.mysql-connect]: Too many connections in /nfs/c04/h02/mnt/62444/domains/deathcabforcutie.com/releases/20090526132419/cake/libs/model/dbo/dbo_mysql.php on line 102
Too many connections
It looks like they’re using CakePHP and perhaps the caching system (or lack thereof) needs a little tuning. Here’s a couple pointers for whoever supports this site:
- The homepage shouldn’t require any database reads! If the content is in a CMS then only a dirty cache page load should require a read.
- If you’re doing any writing to MySQL for anonymous users (analytics, etc) time to get rid of this. Use something like Google Analytics for analytics.
- A quick and dirty approach to tuning is to set Apache’s MaxClients and MySQL’s max_connections to the same value. That way when the site gets overloaded, users don’t continue firing off HTTP requests, which in turn add fuel to fire.
- Might be a good time to add a CDN to the site. This won’t solve any MySQL problems, but if you’re pushing 1.5 MB of content to users, might as well use something like Amazon CloudFront to do the heavy lifting. Then your web server can just worry about serving up just the HTML.