Hey everyone,
I’ve been using DigitalOcean for hosting several of my projects, and I’ve recently run into some issues configuring load balancers for a high-traffic website. Here are the details of my setup:
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there,
As this is only happening during peak traffic times, there are a few things that I could suggest here:
On the backend Droplets side:
On the database side:
Sometimes adding a few indexes can drastically improve the performance of such slow queries.
If you have a lot of read operations, you could plan on scaling horizontally by adding some read replicas and configuring your app to use the read replicas for all or some of your read queries, that way you will reduce the load on the primary server which will only handle the writes. Depending on the framework that you are using this might be easily configurable, for example, Laravel offers this out of the box.
On the sessions side:
On the load balancer side:
Hope that this helps!
- Bobby