The Time I Was Top Link on Hacker News and Azure Killed My Site
At a certain point, my post got the first position on Hacker News... and then my site went down.
Join the DZone community and get the full member experience.Join For Free
monday morning (usa time) 31st october 2016, at a certain point my post about “ surface book vs macbook pro ” got the first position on hacker news . it triggered a good amount of discussion , and luckily the tech-savvy people commenting managed to go on using either the google cache or directly reading from the rss feed (which is distributed via feedburner, thus static).
how did i notice it? because someone wrote me on facebook that my site was down. the error i got was:
going to the page linked from the error, azure sql database resource limits , looks like the problem is that i reached the maximum number of workers allowed by my sql basic tier (30).
also, dtus were maxed out, according to the resource chart from azure portal.
all these was due to the huge number of requests arriving from hacker news, more than 40k per hour… with more than half of the response returning http errors. normally i have less than 500 per hour, so a huge peak.
i’m running on azure thanks to my msdn subscription, which entitles me to 130 euro per month to spend on azure. so i had a standard tier for the web and a basic tier for sql server. and at the time i set them up this was almost maxing out my budget. i realized lately i was just using less than 40€ per month, so i upgraded the sql server to the standard tier, which has 60 workers and 10 dtus. unfortunaly, it took 3-6 hours to scale up a database (even if mine is pretty small, less than half gigabytes). so i guess i lost the traction of the first visits from hacker news. i would have expected azure to allow sporadic peaks (i’m usually at half dtu all year long, and for the 3 hrs i’m above the limit they shut it down?).
what did i learn?
short term solution, thanks to some suggestion from some friend, i set up my site under cloudflare . it is a kind of cdn which caches my website and serves it up to the world. it caches only static files (js, css, images) but by default, it doesn’t cache dynamic pages, so i’ll have to understand how to configure it to cache them and also keep the backend outside and update pages after comments have been added.
longer term solution: move away from subtext and from azure. this was already something i was planning to do since my msdn license was a benefit of being mvp. and not making any money out of my blog (apart from the sporadic 5-10susd a month i get from ads) i can’t afford to spend 50€ a month on azure fees.
i’m evaluating some options for the new home of my blog: one is making everything static, and host it on github pages. another is migrating to another blog engine built with umbraco, articulate , and run it from umbraco cloud .
Published at DZone with permission of Simone Chiaretta, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.