9
0 Comments

🤦‍♂️ Blog post became viral then the server crashed

Hey everyone 👋

A few days ago Bootstrap 5 Alpha was officially launched and since we build themes using Bootstrap and we also have a blog we thought it would be a good idea to quickly set up an article and distribute it on our social media, reddit and so on.

After about 1-2 hours of writing the article it was ready. I also created a custom preview image to make it more shareable on social media. Here's the article if you're curious:

https://themesberg.com/blog/bootstrap/bootstrap-version-5-alpha-whats-new

I started to share it on our social media, relevant subreddits, designersnews, hackernews and so on. Little did I know what would happen. With my co-founder, Robert, we even started joking around that it might crash our server lol.

So after sharing it on these multiple platforms the Google Analyics live users was like this: 20, then 50, then 70, then 100, then 130 and so on. I went outside for a couple of minutes and when I got back my colleague told me that he can no longer access Themesberg.

I was like... what? This never happened before. So I took a look and indeed, it was not working. Like at all. Anywhere. Started panicking a little since this was a crucial time especially because of the many visitors.

I took a look on our server logs and hundreds of 500 server errors were popping up. The queries no longer worked. The culprit was a stupid query that counted all of our users for every page accessed. I quickly hardcoded the count and later on optimized the whole thing.

The damage? Around 700 lost visitors in the 10 minutes while the website was down.

Lesson learned? Optimize your queries. Update your hosting. We were on the cheapest plan on Heroku.

We also switched to Cloudflare for DDoS protection because this was a period of security paranoia LOL.

Keep building awesome stuff people,
Zoltan, CEO @ Themesberg

Trending on Indie Hackers
How I grew a side project to 100k Unique Visitors in 7 days with 0 audience 49 comments Competing with Product Hunt: a month later 33 comments Why do you hate marketing? 29 comments My Top 20 Free Tools That I Use Everyday as an Indie Hacker 15 comments $15k revenues in <4 months as a solopreneur 14 comments Use Your Product 13 comments