• The ImunifyAV extension is now deprecated and no longer available for installation.
    Existing ImunifyAV installations will continue operating for three months, and after that will automatically be replaced with the new Imunify extension. We recommend that you manually replace any existing ImunifyAV installations with Imunify at your earliest convenience.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question Setup Plesk behind a load Balancer

Airborne3d

New Pleskian
Server operating system version
Debian
Plesk version and microupdate number
Latest
Hello dear Plesk People,


I want to set up a cluster of servers in a load balancing configuration and also get the benefit of high availability. This is my first ever attempt to do anything like this, but with Plesk and Hetzner, it should be possible somehow - I just don't know exactly how yet.


I have read on multiple threads here that some people are running load balancers with Plesk, but they have never specified how their setup looks. However, my thought is to use Hetzner Cloud + Hetzner Load Balancer. The setup in mind is as follows:


  1. Small cluster of MariaDB Galera + load balancer for the database to connect it to Plesk as an external database, as seen from this tutorial "Link"
  2. NFS to store all the website files; this could be a Storage Volume by Hetzner "Link" or any other available solutions
  3. 2-4 identical servers running Plesk + Hetzner Load Balancer, similar to this setup "Link"

In this setup, one server would act as the master. The master server would be used to manage all websites and also handle the scheduled backups.


I have not yet started to set this up since there are a few problems I'm seeing right now. The main issue is how do I sync all the Plesk instances with each other? For example, user creation, PHP settings changed by users, and so on.


In the proof of concept with the HA cluster "Link" they are not load balancing - they just have an active node and a passive node. They installed Plesk on 2 separate nodes and moved "Plesk" to the NFS too so both nodes can access the Plesk data. But I want multiple active nodes running in sync with each other.

So to all of you who have Plesk running behind a load balancer, how have you overcome this problem?
 
So in a typical setup without running Plesk you would just stage up a server with the site and configurations you want setup for your front end. The front end would talk to a specific internal DNS name to talk to a cluster of database which syncs to each other and what not, This way you can spin up more front end servers as needed and more backend database servers as needed. This is usually load balanced off of the DNS names so you would have 2 different load balancers, one for front end (that the public uses to get to) and one for backend (for the front end servers to reach the databases).

This isn't as easily to do when you throw Plesk in the mix. HOWEVER Plesk does have the ability to be installed as a HA (High Availability). It isn't the same as load balancing but it's useful if something goes wrong you have that backup server available to be available. It does involved quite a bit of a set up though to do. You can read more about it over at How to Install Plesk in a High Availability Cluster and Input - Plesk in a High Availability Cluster
 
@Airborne3d

There are some basics to consider first, before starting the installation of a HA cluster.


The statement

HOWEVER Plesk does have the ability to be installed as a HA (High Availability).

is misrepresenting what actually is possible : (almost) every type of software can be installed WITHIN a cluster.

Plesk is not different.

However, Plesk itself does not have the abilities related to a HA cluster.

More importantly, Plesk does NOT have the ability to RUN a cluster of any kind.

Stated differently, when installing Plesk on a HA cluster, one simply has (fail-over) copies of Plesk instances.


In theory, Plesk itself will not require additional maintenance, when installed in a HA cluster.

In practice, each Plesk instance in a HA cluster requires ADDITIONAL maintenance.

Stated differently, with a HA cluster, one really has double the costs (servers) and double the work (maintenance).


The question is whether there is an advantage to gain with a HA cluster.

Well, if it is double-the-costs-and-work, then advantages seem to be absent.

This is not really true though, since there is a gain in the HA part (High Availability) of the HA cluster.

Let's call it the HA gain.


The question is whether that HA gain is materializing sufficiently to offset the disadvantage of double-the-costs-and-work.

In a Hetzner environment it is 100% certain, that the HA gain will never materialize - for many reasons that I will not explain here.

In a cloud based environment (as opposed to the virtualized environment marketed by Hetzner as "cloud"), the HA gain can materialize.

For instance, when using Azure, the HA gain can materialize to a very (very) high degree.

In fact, Azure has a considerable number of services that make all kinds of work related to HA clusters fully obsolete - just spin up and run the cluster!

The problem here is that the costs of cloud based environments are prohibitive.

In essence, it is a quadruple-the-costs-and-halve-the-work kind of situation.

Nevertheless, if you really want to have a HA cluster, then simply spin up a cloud based cluster and install Plesk in it.

The HA gain materializes, but at a considerable price.


The question should also be whether the HA gain can materialize within a specific type of cluster and/or with specific types of software.

This latter question is really (really) important.

One of the big bottlenecks of Plesk is the MySQL database.

One can use a DB Cluster, causing bottlenecks in data transfers (lowering the performance of the Plesk instance that uses the DB Cluster) and also causing a considerable increase in the attack surface (making all Plesk instances and the DB cluster less safe and more prone to hack attempts).

One can use a dedicated server with one DB server, but the issues are the same as with a DB cluster.

One can use a policy of one-db-per-one-Plesk-instance ....... and this is often most secure, reliable, update compatible and most performant and cheap !

Stated differently, software like Plesk and its dependency on MySQL simply reduces the HA gain.

Actually, in most cases, using a DB cluster (HA or not) will not give any outperformance - this DB cluster should not be part of the cluster type.

As a result, the dependency of Plesk on MySQL really limits the use of the fine HA Cluster technology for creating fail-over Plesk instances.

One should simply have a look at alternative solutions.


The HA gain is not associated with HA clusters alone.

The essence of HA gains is that you will have a fail-over copy of a specific Plesk instance.

The essence of a good server setup is also to "KEEP THINGS SIMPLE".

One can realize the two aforementioned essences by simply using

1 - 2 dedicated (big) servers, each with their own Plesk instance and their own set of domains hosted on that (big) server,
2 - one DB server per dedicated server, hence mitigating the MySQL bottleneck as far as possible,
3 - an external nameserver solution, with a sufficient API that can be addressed programmatically,

and add to that

4 - a script, allowing frequent migration of hosting data between server A and B AND vice versa (read: creating static replica's, not yet dynamic fail-overs)
5 - Nginx directives, duplicating requests to server A and forwarding them to server B AND vice versa (read: static replica's becoming dynamic)
6 - a script, testing for domain and/or server downtime (read: first step of creating fail-over functionality)
7 - a script, programmatically altering the DNS entries in the external nameserver, when one server is down (read: second step, now there is fail-over)

and the word "simply" is not entirely correct, since this is quite cumbersome ...........to setup.

However, whenever setup properly, it works like a charm - it will be update safe, cost effective, very performant and a GOOD ALTERNATIVE.

Then again, it is a "good alternative" to allow for the HA gain to materialize, but it is NOT the best alternative!

One can simply improve that good alternative by migrating part of the environment to the cloud and - for instance - use shared disks (shared across cloud based VMs, hence creating fail-over by using a shared disks) and/or load-balancers (in front of the cloud based VMs).

It simply is a matter of choice ........ and of evolution.

After all, the essence of "keep things simple" should by nature also imply that you keep things simple, as required by your specific situation and GOALS.


In summary, any HA cluster or anything that will materialize (part or the entirety of) the HA gain is a trade-off.

The trade-off primarily concerns costs versus work (maintenance and installation) versus overkill.

I am explicitly adding "overkill" to the equation.

After all, in most use cases, it should be sufficient to have a number of Plesk instances with backups (copies) created in such a way that those backups (copies) can be materialized into working domains (or hosting environments) in a couple of minutes.

HA clusters tend to be an overkill in most use cases - good for cloud providers or multi-server based analysis, but often bad for hosting providers.

If and whenever you want a HA cluster or something that resembles it, then please consider that you will often not have the need to do so.

If and whenever you want a HA cluster or something that resembles it, then please make use of already existing infrastructure offered by cloud providers.

And please be aware that "cloud providers" are defined by Oracle Cloud, Azure, Google Cloud, Amazon and such alike.


I hope the above helps a bit!


Kind regards....
 
Back
Top