Load Balancer Drupal Configure for Beginner

May 10, 2018 103 views
Load Balancing Drupal MySQL Ubuntu 16.04
modev
By:
modev

Very new to load balancing here and doing my research before making the plunge. Right now I have a single server running Drupal 7. It's using complex mysql queries and hosts a large amount of user uploaded images. To prepare for the future and continued expansion I'm looking at the following setup. Wondering if this makes sense, and any suggestions on tools to get the job done:

Public Application (Private) Database (Private)
Load Balancer Drupal Droplet Master Mysql Droplet
Drupal Droplet Clone

My thoughts here:

  • lysncd to keep D7 application files matching
  • DO load balancer
  • Switching to NGINX for web service
  • Sticky sessions: on
  • HTTP/2 SSL Termination
  • My bottle neck could still be the mysql server but I don't think I'm ready for make a data cluster

Quick Questions:

  • Is it worth using GlusterFS instead of lsyncd? Best way to keep files synced if I need to add more application nodes?
  • I may just run one application node, and boot up the second from a snapshot during peak volume times, thoughts on this approach?

Looking for guidance here:

  • The node attachments (99.9%) images can take up a lot of space, I'm thinking use S3 to host these files (the domain name isn't that important for these). This would allow me to not worry about replicating files on both application nodes or worry about running out of storage on a small sized node. Any thoughts on this approach? I would have considered DO's block storage, but it looks like it can only connect to one node at a time. How about a specific application node dedicated to file storage instead of S3?
2 Answers
ryanpq MOD May 18, 2018
Accepted Answer

Is it worth using GlusterFS instead of lsyncd? Best way to keep files synced if I need to add more application nodes?

With just two nodes lsyncd might be a better option as it would provide quicker access to files since everything will be stored locally. GlusterFS may make things easier once you have 3 or more nodes and would also allow you to make more efficient use of your available space across nodes.

I may just run one application node, and boot up the second from a snapshot during peak volume times, thoughts on this approach?

This approach would work but you would need to configure a method to increase space that will both spin up the new node from a snapshot and update nginx so that traffic is routed to it (or if using the DO load balancer service you could do this via the API).

The node attachments (99.9%) images can take up a lot of space, I'm thinking use S3 to host these files (the domain name isn't that important for these). This would allow me to not worry about replicating files on both application nodes or worry about running out of storage on a small sized node. Any thoughts on this approach? I would have considered DO's block storage, but it looks like it can only connect to one node at a time. How about a specific application node dedicated to file storage instead of S3?

Using object storage like S3 or DigitalOcean Spaces would be a viable solution here that should reduce the requirements on your nodes and would not need to set up some type of live redundancy of your files since you would reference the object storage directly.

Thanks, ended up using added a DO volume to the DB server and used NFS mount for the static files on each WEB server...thinking this is the simplest solutions...still testing performance.

Lsyncd works great and is allowing multiple nodes with a quick setup.

Have another answer? Share your knowledge.