1 post tagged “godaddy”
From what I can tell, static content is far less likely to cause a server outage or get your site pulled (from a web host like godaddy) than is dynamic (i.e. heavy php/asp & database queries). This I suppose stands to reason: they don't want the entire box to go down (and thus every other domain hosted on the box) and the sure way to bring a box down is to run out of ram. Now I'm not exactly sure how this works but I'm guessing the longer it takes the box on average to serve a page, the more simultaneous requests it will be serving, and thus more ram utilization. This assumes that your entire site fits in ram as it is which is a given for tiny sites like mine.
Still, it apparently is still a bit of a risky business, being hosted by someone like godaddy, because they can still pull you if the box is particularly busy that day and you're taking more than your 'fair' share, even if that share is pretty trim.
Certainly maximizing the amount of static content on your site is an all around good step, but an even better solution would be dynamically swap the server (to amazon let's say) in the event of a digg event. Here's how it would work: Your site normally doesn't get that much traffic and is happy as a clam running php scripts all over the place and hitting the database 10 times each page. But then let's say a php script detects crossing a certain threshold of page-requests per minute and does 2 things: 1) starts an amazon virtual server that mirrors your site's static content, and 2) swaps the DNS (domain name servers) such that your domain now points to the amazon virtual server, and something like store.domain.com points to your shared host. You set the links up so that people that need to access dynamic pages are linked to the godaddy site, and that the static content is hosted by the virtual machine. When traffic falls again to below some 2nd threshold, the DNS is switched back. This would allow you to use a really cheap web host (i.e. 4$/month) but have some serious firepower for those special occasions.
I just did two stopgap things to my site tonight: Nixed the php that recorded each and every page request (and session data) to a database, and nixed the code that looked up whether or not to display a link to the shopping cart. (Now it just displays it all the time. Before it would only show up of something was in your cart.) http://www.saleae.com
For now I'm leaving the page-construction and session_start() php in there. I figure that's gotta be pretty damn fast anyway. Ultimately I'll cache the page-construction.
I'm a little uncomfortable with two things though: 1) When you have completely static pages, you loose session info that could be critical for analytics and 2) If for some reason session tracking on the dynamic cart pages has to resort to using get tags (i.e. the user has disabled cookies) that's not going to propagate once the user leaves the cart page.
Update: I was just thinking that above issues could be resolved 99% of the time by dynamically switching to static content when you need to instead of always hosting static content.