Member-only story
What happened when my side project suddenly went viral?
My project botmake.io usually had around 1000 daily visitors with quite a stable graph for a long time. It was running on a $10/month DigitalOcean server (2GB memory and 1 CPU) was quite enough for that traffic. The stack of the project is LEMP and it is built with Laravel.
One day I got an email alert notification my website is down 😱. I quickly logged into the server and restarted the PHP-fpm (this always works in panic situations) and the website was up again. Then I quickly checked Analytics if this is happening due to high traffic and yes I saw around 200 people in real-time and the server already was operating on the limits in terms of CPU and memory.
The first thing that came to my mind was to increase the capacity of the server I switched to a $20/mo server (2 CPU and 4GB memory) and was thinking it will be enough to solve the problem. Yes, it helped a bit but traffic also continued increasing and I started to see around 400 people. It was time to increase some limits in configurations as PHP-fpm children, max MySQL connections, etc. After these changes server was able to manage more people but it was going down sometimes. On that night I went to…