Performance and reliability are two key factors that contribute to a user being happy when using a website/app. They tend to not be forgiving when a website fails to load especially when it comes to browser extensions. If it doesn’t work the first time, they often uninstall.
I’ve written about how I’ve improved performance of my Weather Extension by making code changes but as the extension has grown, I’ve also had to scale the backend infrastructure to handle the additional load.
Load Balancer Key Features
- Simple to setup (Took me less than 10 minutes to setup)
- Improve availability (If a server goes down, the traffic will be routed to the other servers)
- Scalable traffic capacity
When setting up the load balancer to work with my Laravel Forge servers, I did run into one issue. The default health checks failed and my server immediately went down. After some help from Alex Bowers, who suggested switching the health checks from HTTP to TCP. This change fixed my issue (Thanks Alex!). He also suggested to run sudo ufw allow ‘Nginx HTTP’ , but my servers worked without running this command.
My current setup for my Weather Extension is a DigitalOcean load balancer with two droplets ($20/m and $10/m). The $20/m server acts as the database and cache server. As the number of users for Weather grows, I can now scale my servers horizontally with zero downtime!
Please leave a comment below if you have any feedback or questions!