
Practical scaling techniques for web sites - derwiki
https://medium.com/@derwiki/practical-scaling-techniques-for-web-sites-554a38dbd492#.8i5i73u3z
======
DamnInteresting
I operate a website that receives moderate-to-occasionally-enormous traffic,
but it only brings in a modest income. Consequently I have taken measures over
the years to squeeze the most out of our cheap little server (4GB RAM):

1) I cache HTML aggressively on a RAMDisk.

2) Everyone (apart from the visitor who triggers the page generation) gets the
cached page.

3) Portions of the page that are user-specific--hence skipping the cache--load
dynamically when they are almost scrolled into view (sorry JS haters). Same
with many images.

4) Requests are piped through CloudFlare for some free CMS.

5) Remaining static files are served via a low-cost CMS.

This setup has managed to remain online with as many as 6,800 concurrent
visitors, though at that point it started barfing '500 Internal Server Error's
into some viewports.

I avoid stale cache files by just dumping the entire cache any time any
content-altering event occurs (e.g., new comment, edited post, etc). Since
it's on a RAMDisk, it's quick to delete and rebuild. When our traffic is huge,
it's always concentrated on one or two pages, so the important part of the
cache is quickly restored.

~~~
TomMarius
What do you mean by CMS? Maybe a CDN, or am I mistaken?

~~~
DamnInteresting
Oh, whoopsie doodle. I did mean CDN. Sorry about that.

