I have one droplet and I want to run it smoother as possible and that is why I consider adding a load-balancer.

But I was wondering whether it is necessary because it can’t distribute the traffic.

And an extra question, is it possible to copy the same droplet into (or any other way) two to make use of the load-balancer.

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.

×
Submit an Answer
1 answer

Hi there @wenuka,

Indeed having a load balancer with 1 Droplet only would not really add much of a benefit to your setup.

However, adding a second Droplet and a Load Balancer would be a robust solution:

Loadbalancing

I could suggest going through this introduction to Load Balancing tutorial here:

https://www.digitalocean.com/community/tutorials/what-is-load-balancing

To copy a Droplet, you could take a snapshot of the existing Droplet and then create a new Droplet from that snapshot. That way the new Droplet will be an exact copy of your current Droplet.

Hope that this helps!
Regards,
Bobby

by Melissa Anderson
Load balancing is a key component of highly-available infrastructures commonly used to improve the performance and reliability of web sites, applications, databases and other services by distributing the workload across multiple servers. A web infrastructure with no load...
  • Thank you very much.

    Regarding creating a new droplet, I have hosted a moodle with the database in the droplet. In this case, it is not as simple as creating new droplet using a snapshot, right?

    • Hey @wenuka đź‘‹,

      Yes indeed, as there is a database involved, you have a couple of options:

      • The most robust solution is to create a third server which would be used hosting only your database, similar to this setup here:

      Load Balancer setup with 2 web servers and 2 DB server

      • Another option would be to configure your second web server so that it connects to the database installed on your first webserver. This is really not ideal as if the first web server crashes it will take down the second one as well:

      Load Balancer setup

      • Third option would be to keep only the 2 Droplets and setup MySQL replication to sync your data between the two:

      Load balancer and mysql replication

      This would add some extra complexity as you will need to manage the MySQL replication. You can follow the steps on how to do that here:

      https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql

      Hope that this helps!
      Regards,
      Bobby

      by Etel Sverdlov
      MySQL replication is a process that allows you to easily maintain multiple copies of a MySQL data by having them copied automatically from a master to a slave database. This can helpful for many reasons including facilating a backup for the data,a way to analyze it without using the main database, or simply as a means to scale out. This tutorial will cover a very simple example of mysql replication—one master will send information to a single slave.