Load Balancing

Load Balancing

Load Balancing

Using Multiple Zope Clients for Load Balancing

Plone/Enfold Server let you create multiple Zope clients for your Plone site(s). These Zope clients can be installed on a single machine or multiple machines. These Zope clients can be installed on the same machine as EP or a different machine.

The main advantage of having more than one Zope client is to make use of multiprocessors and/or to spread the use of RAM and CPU across multiple machines. Depending on RAM and CPU, it is common to have more than one Zope client per machine. By default, Enfold Server uses only one Zope mount point, so all configured Zope clients will use the same ZODB.

Load balancing lets multiple machines respond to http requests. If one machine becomes inoperable, the other machines part of this load balancing cluster can continue responding to requests. In the context of Plone/Enfold, multiple machines could have Zope clients running and be connected to the same ZEO server (or Enfold Server). Enfold Proxy lets you do that.

Enfold recommends that you use three or more Zope clients when load balancing. Although they can be on a single machine, for redundancy and safety it is good to have at least one machine when load balancing. Enfold Proxy can load balance Zope clients from any machines which are running Zope/Plone (regardless of whether they are running Linux,Windows, OS X, etc).

Note: Before you can load balance, you should verify that your Zope clients can be load balanced.

Adding or Subtracting Load-Balancing Clients

After you create a proxy definition for your host, you can add load-balancing clients with one step: add another entry in the Virtual host field. This Virtual host field is located on the Basic tab of your proxy definition. (The balancing tab of your proxy definition contains additional options related to load balancing).

Here are examples of Virtual Hosts to include in your proxy definition (on the Basic tab). All formats listed here are acceptable:

localhost:8080
localhost:8090
192.168.1.150:8080
192.168.1.151:8080
www.enfoldsystems.com:8080
Notes:
  1. In most cases, these URLs will be a Zope client.
  2. Omit the http:// prefix.
  3. Always include the port number.
  4. You can use IP addresses and/or host names.
  5. Load balancing will not work unless you have 2 or more Virtual hosts listed here.

After you push save, load balancing should work immediately.

To remove a client from load balancing, delete the appropriate line in the Virtual Host field.

Even though load balancing provides a kind of insurance policy against failures, you still need a monitoring tool like Big Brother to make sure individual machines are online. A load-balanced cluster might have four virtual hosts/Zope clients and still work if three of them go offline. But if you are never notified about this occurrence, you would be at risk if the fourth goes offline also.

Configure Load Balancing Options

The Balancing tab of your proxy definition contains several options to configure for load balancing.

Verify that your Zope Clients can be load balanced

Enfold Proxy has the ability to balance requests from multiple Zope clients. These Zope clients can exist on the same machine or be spread out among several machines. However, load balancing assumes that each Zope client is using the same Zope object database (ZODB) and the same Zope mount point. That means that the zope.conf file for each Zope client must be configured to reference the same ZEO server and file storage location, regardless of whether the Zope clients are located on one machine or several machines.

Before you add a Zope client to load balancing, you must verify two things. First, verify that the Zope client can be accessed directly by typing the IP address + management port. If you can type http://localhost:8080 in your browser (or the equivalent), that is sufficient.

You should also verify that all Zope clients have identical ZEO servers, mount point(s) and ZODB file. (By default, all Zope clients installed by Enfold server use one mount point and the same file storage location).

Here's some basic steps for doing this verification:

  1. Compare Zope.conf files and make sure that the mount directive is identical to the other Zope client(s). (If these Zope clients are on different machines, they may refer to the ZEO server differently with a different IP address or URL. That is ok).
  2. Start/Restart the new Zope client.
  3. In the ZMI root, go to the Control Panel, Choose Database Options. Verify that the name of the ZODB storage for your new client is identical to your other clients.
  4. Point your browser directly to the Zope client. Try editing a web page on one, and see if the changes are reflected at the same page at the different Zope client. Suppose you had two Zope clients on different machines which you thought had the same mount point. At client 1 (http://192.168.1.150:8090) (client 1) login and modify a web page. Now go to client 2 (http://192.168.1.151:8091). Do you see the change you just made here on Client 2? If yes, then you are connected to the same mount point.