The fallacy of mass hosted blog

We all know that dynamic web pages consume CPU and memory resources on the server. So, how can mass web hosting companies provide PHP *and* MySQL support on a $3/mo account? Well, as I found out the hard way (my blog was down for the most of last week since it cannot handle even modest amount of traffic), you get what you pay for …

To be fair, I do understand the need to constrain the number of PHP threads for each shared account to make sure that no one is hogging is resources. The hosting company does not state this limitation when you sign up for their account — all you see is the number of MySQL DBs, mailboxes etc. The number limit on PHP threads is NOT mentioned! However, when your web site hits 25 concurrent PHP threads, all of the sudden, it stops working. And it does not just refuse requests beyond the 25 thread limit. It stops working altogether for 4-5 hours!

Now, 25 concurrent PHP threads should be enough for most sites. I mean, assuming the load is evenly distributed, even if a request takes a long 25 seconds to process, the site is still capable of 60 page views per minute (that is 3600 page views per hour and 86k page views per day). The throughput would be much higher if the processing time is shorter. Considerring that traffic is not evenly distributed, I’d still expect 1000+ page views per hour. So, why did my site crashes when the page view is merely 150 per hour? Oh well, that is because I am running a blog site. A lot of RSS readers would automatically poll my site every a couple of minutes and that is not included in the “page view” stat. So, in reality, my RSS feed PHP script is executed more than 10x of my regular HTML page rendering PHP script.

In any case, I am done with “shared” hosting. I will only use my account for static files (e.g., images). I am now moving my blog to a VPS solution where I have guaranteed server resources.

3 Responses to “The fallacy of mass hosted blog”

  1. Markus Says:

    Good luck with the VPS. My experience is not that good with VPS either:

    http://labora.harnvi.net/?p=27

  2. Robert Says:

    Something else you can do for wordpress is use the wordpress cache (google for wp-cache). you can set the cache time, clear it out, etc. It really saves on db access and processing. A lot of people use it, including me.

  3. Michael Yuan Says:

    Thanks for the tip. Yes, I already tried wp-cache. It helped but did not solve my problem …

Leave a Reply