By josen wily
wily
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!
Accepted Answer
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:
https://docs.digitalocean.com/products/databases/mysql/how-to/monitor-databases/
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.