As some may have seen over the past few weeks, ServeTheHome has gotten relatively hammered. As a result, the site which was running perfectly well in June 2011 was seeing stability issues in late August. I decided to take the opportunity to see if I could speed things up a bit.
Fixing the Problem – Using More Resources
The first big change was moving to a new Virtual Private Server (VPS) with more CPU/ RAM. I noticed some spiking memory usage which was giving users sporadic 500 and 404 errors. I will note that although the change has been made, I am still thinking strongly of just hosting this in Amazon EC2 so scaling will not be an issue going forward.
As many note, unlike many tech sites that try increasing page views by splitting one or two pages of information into six to twelve, I like keeping pages a bit larger but requiring just scrolling and no clicking. Maybe it is using my MacBook Air or my iPad regularly both of which do great scrolling but where clicking is not as precise. One thing a lot of users have noted is that page times, especially with the pictures I use tend to suffer. This was a bit more complex to fix.
My first thought was bigger, better VPS would mean better performance. It did to some extent, but WordPress started to regularly run away with memory usage and start crashing. After about a week of nightly Google searches, I had a few fixes in-place that fixed the issues (hopefully but it seems to be working.) The additional server resources meant anywhere from 5-15% faster page loads.
My next thought is that locating my site in California, USA and also being in California (albeit about 400 miles away from the servers), meant that I was probably seeing close to a best-case load times, and they were not all that great. The next step was moving a lot of media into Amazon’s cloud and making available from more locations. You will see things like media.servethehome.com in the status bar when images are being served from the cloud. In initial testing, this is making a much bigger impact than the bigger virtual machine.
Now that this is all working decently I am going to request that anyone that sees images not loading or something wrong either use the contact forum to submit a bug or feel free to post on this forum thread.
I think the next big infrastructure improvement will be moving the remainder of the site to an Amazon EC2 instance. I really do not want to deal with scaling issues in the near future so I can get back to making more content.
- According to current projections, the faster page loads will save users approximately 200,000 seconds each month! That is well over two days worth of time savings each month.
- ServeTheHome.com’s predecessor was hosted on a Windows Home Server (32-bit) WAMP installation. Total duration of this endeavor was under 36 hours.
- STH was originally hosted on a shared server. This worked fairly well, but as the site grew throughout 2010 and into 2011 (2009 growth was minor at best), this did not work.
- I have now tested no fewer than fifteen virtual private server providers for the site and am marginally happy with the current setup.
- Approximately every 60-90 days I build out a dedicated server for STH. In fact, when I bought the Supermicro SC216E1 chassis that I eventually reviewed, the goal was to turn that into the enclosure for the STH web server hardware. At the end of the day, I always come to the conclusion that I do not want to be responsible for changing hardware in a remote location in the middle of the night.
Thanks everyone for making this site a bunch of fun to maintain and a useful resource to many! I will still look into making the site faster, since I know STH is still far from great in terms of loading speed, but hopefully the latest re-configuration will help a lot.