The growth of my cocktail recipe website has been truly scary this year. I am into my second year of >100% year on year growth in the site, I have doubled in volume since January and if anything growth is accelerating.
The plan of course is to keep growing and doing well. I am currently at 2/3 of the bandwidth limit my web hosting company allow me which although cool is very scary when you look at last year's traffic distribution numbers:
The above December to October ratio is typical, I have seen it for the past 7yrs every year with December having roughly 3x the traffic of October (you can see the huge growth in last year's graph from Jan to Dec as well). In the peak day of december (new year's eve) I expect to be serving about 4cocktails a second (30% above my current recorded intraday peak) with an intraday peak of 7 cocktails a second. My code/databases can stand this but I am not a professional coder and want to be sure so I am working on making my code more efficient at the moment, adding more caching, planning (finally) to migrate to a very professional hosting package and place all images/css on a content delivery network like Amazon S3 (because whatever happens my current bandwidth is screwed).
The main point of this note is to encourage you guys to check out your code. I just recoded the displaycocktail.php script on my site (which accounts for 20% of bandwidth and >50% of files served). It turns out this script (which has grown organically and been coded in chunks since 2001) is horribly inefficient. I reduced the lines of code in the script by 55% to just 304 including all HTML and the weight of the page produced by 21% which will reduce my bandwidth usage by 4-5% which is cool and also has halved the SQL queries per page load on that page.
Efficiency is dull but I am hugely glad I did this and am looking forward to running through the rest of the site spring cleaning in Fall. If nothing else it will allow me to have a much smaller, easier codebase to maintain which is definitely good news!!!
Comments