I’ve been concerned about a couple of potential issues as the audience for USWildflowers.com grows, and while the jury is still out on the effectiveness, I hope they’ll be helped a bit by using a CDN – Content Distribution Network. I doubt this will interest most folks reading this journal, but I want to get it down “on paper” as a record of when and why.
The concerns I’ve had are based on the profile of growth from February to April of 2010. The weekly traffic in April 2010 was about 15 times that of February 2010. For a wildflower site, with the spring being the primary season, that profile seems reasonable. The traffic so far for 2011 is about 4 times the traffic of 2010; if the ramp-up of traffic follows the profile of last year, we could have some really heavy-duty load on the webserver hosting USWildflowers.com. I am using shared hosting for USWildflowers.com, and the “rumors” I hear imply that load could be a problem.
So based on that profile, these are my concerns:
- I may exceed the allowed utilization of the shared server. While bandwith utilization is “unlimited” at Hostgator, my hosting provider, and there are no hard limits on server utilization, there is a caveat that I can’t use so much resource that it impacts other clients of Hostgator. If USWildflowers.com starts impacting other clients, Hostgator can shut it down.
- Response time on USWildflowers.com has gotten worse over the past several months, even as traffic has declined during the off-season. I suspect that this is primarily because Hostgator is ramping up the number of accounts they put on a single host as they have grown, and as competition has forced them to bring (new) account prices down. In any case, I don’t want folks to leave the site just because they have to wait too long for a page to load.
I had been looking for options to deal with this issue for the upcoming season for quite a while. Dedicated hosting is not an option financially (the advertisements on USWildflowers.com have yet to exceed the costs of the website), so I couldn’t move in that direction. Hostgator was running a sale late last year, and I took advantage of that to get an upgrade to “business” in hopes that would place me on a better performing server (it also provides some other features I wanted.) Unfortunately performance did not get better.
Also late last year I ran across Cloudflare, a CDN – Content Distribution Network. The theory is that CDNs are more closely located to the website customers than are the underlying webservers, thus providing faster response time – item 2 on my list, and they cache content so that many requests are fulfilled without a hit to the original website, reducing the load on that website – item 1 on my list. Most of us have heard of Akamai, a major CDN, but I’d never heard of Cloudflare. Akamai has many, many huge datacenters around the world, Cloudflare only has 5 or 6. That means Akamai is more likely to be closer to the person hitting the site, but Cloudflare has a major advantage for me – it’s basic features are free. So in order to test the process and stability, I moved one of my very small websites (molderingprivy.com) over to Cloudflare in Novemember. After running that one there, I moved USWildflowers.com to Cloudflare on Feb 3 of this year.
So far the jury is still out on how this is performing. Initially I was disappointed; performance actually seemed worse. That might be reasonable in low-volume situations. And while it’s likely that bandwidth utilization at Hostgator will be reduced significantly, I’m not sure how much CPU utilization will be saved. Here are my touch- and watch-points.
- Since I’m about as “distant” (measured in router-hops through the internet) from Cloudflare as I am from Hostgator, the proximity factor doesn’t factor in very much.
- I also didn’t realize before I moved over to Cloudflare that html content is not cached, so that means that in addition to getting the content from Cloudflare, Cloudflare has to go back to my server to get the html content, making the total distance greater than if I got it directly from Hostgator. The rationale for not caching that is to ensure fresh content to the consumer, but I’d like to be able to have it cache the html content based on the entire URL, including parameters, for a period specified by me.
- Since the html isn’t cached, the MySQL and PHP backend processing on Hostgator isn’t reduced. Since I don’t have access to statistics on CPU utilizatization at Hostgator, I don’t know how much impact my backend processes have on the server, but I’m sure generating the html via the PHP processing and MySQL calls are the lion’s share.
On the plus side:
- The images from the website (and certain other content) are cached at Cloudflare for a period of time (up to 4 hours, I think.) As traffic increases, the likelihood of getting a hit on a cached image greatly increases, and as traffic has increased over the past couple of weeks, the response time on USWildflowers.com seems better most of the time. Google Analytics does not confirm that trend yet, so we’ll see.
- Cloudflare claims to have saved 1.1GB out of a total of 1.9GB of bandwidth in the nearly two weeks of use. Hostgator should be happy about that, and that should reduce any likelihood that bandwidth utilization will result in Hostgator placing sanctions on USWildflowers.com.
- Cloudflare also claims to be handling about 60% of the hits to the website without passing them on to Hostgator. Since each thumbnail or other image is a hit, this seems reasonable. While the CPU processing to handle the static image request is probably much lower than the CPU required to churn through the database producing the HTML code, reducing those requests will most certainly reduce the CPU utilization to some extent.
- Cloudflare also does some threat checking and blocks certain threats. While this also implies that some valid requests (false positives) might be blocked, it does provide a sense of security against SQL injection attacks and the such, and it has also seemed to reduce the number of spam comments hitting the website.
Bottom line: I’m hopeful Cloudflare will provide what I need in reduced load on my webhost, and am hopeful that the end-user experience will be improved over what it would have been without them. As traffic really ramps up over the next few months, we’ll see…