As Pink Cake Box has grown over the years, we’ve had to focus more time on optimizing site performance. In aggregate, we receive over 1/2 million unique visitors a month with over 2 million pageviews per month. We’ve also taken the non-traditional approach of allowing other sites to link directly to our images. In combination, all this traffic was putting a strain on our web server and was causing performance issues and web site crashes.
In conversations with our web hosting provider they claimed our traffic was in the top .01% of sites they host and the implementation of our web server was not optimized to handle such a load. They suggested we take a look at NGINX which is a lighter and faster web server as compared to Apache. (Check out this web server comparison they did)
We decided to take a different route and ended up implementing three options which appeared to have helped:
Here are some details for others who may be having similar issues:
Our web hosting provider offers Xcache for caching php pages, but the default values were not doing the job. After reading through this excellent xcache post from Chris Meisinger, I started testing a variety of different values for the slot and cache sizes (xcache.size & xcache.slots) and finally settled on optimal sizes that worked best with our site.
I used apache benchmark tool to help test different configuration options:
ab -n 1000 -c 20 http://blog.pinkcakebox.com
Implementing Amazon Cloudfront
Setting up Amazon cloudfront was a breeze. Dreamhost holds your hand through the process and the only work I really had to do was update our wordpress database and any HTML files to point to our new images.pinkcakebox.com.
We noticed a TREMENDOUS performance boost from this approach and it also helped ease the burden on Apache.
Note there are plenty of plugins to help ease the process of integrating Amazon Cloudfront/S3 with WordPress. I personally did not try any of them.
Optimized wordpress plugins/queries
Last but not least I spent time tuning some of my existing plugins and identified some troublesome bottlenecks in third-party plugins. I used this excellent plugin from Frank BÃ¼ltge which lists all your wordpress queries with timings.
The other bottleneck I had was with Version 220.127.116.11 of SexyBookmarks. It was adding 5 seconds of load time to my main blog page. I did NOT investigate if these performance issues were specific to the plugin itself or perhaps a conflict the Sexy Boomarks plugin and another plugin on the site.
All I know is that as soon as I disabled the plugin my wordpress load time decreased by 5 seconds. The folks at shareaholic.com do a great job maintaining this plugin so I’m more apt to believe it was some issue specific with our wordpress site (which is highly customized so I wouldn’t be surprised).