Accessibility

Table of Contents

High availability clustering ColdFusion: Using ColdFusion Enterprise Manager

An introduction to clustering

In essence clustering means combining two or more resources (members) so that they appear as a single resource. The main reasons for clustering are redundancy, so that failure of one resource does not result in the failure of the application and scalability, which enables an application to handle more users as traffic increases by adding cluster members. One other important benefit in clustering ColdFusion is encapsulation. Encapsulation enables you to keep discrete applications or processes in their own dedicated instance. This might be done for security reasons or to segregate load intensive processes such as scheduled tasks. These two principle needs are addressed by clusters that support failover and load balancing.

Note: as you learn more about clustering, you may well hear the term Load Balancer to describe a piece of hardware or software used in clustering. In fact, Microsoft's own software clustering mechanism is called Network Load Balancing or "NLB". These are misnomers because load balancing is a feature of clustering along with fail-over.

Failover

Typically, failover is the most basic need for clustering. In my opinion, every web application needs redundancy so that if something fails the whole application does not fail and become unavailable to users. This level of redundancy is often known as High Availability or HA. Some developers believe that HA is not necessary when an application has a low number of users. If there are any users at all, that shows a need for the application and if there is a need, then the application needs to be available. The good news is that the ColdFusion clustering mechanism supports failover at the instance level. At a conceptual level an instance in ColdFusion Enterprise is equivalent to a stand-alone server in ColdFusion standard; it is a fully encapsulated.

Consider an example of failover in a web application, at the hardware level. In this example the second ColdFusion server in a two server cluster has failed and the clustering mechanism is sending requests to the ColdFusion server that is still responding (See Figure 1). Once you move from one to two of anything, there is a paradigm shift in terms of the availability of the application. If your ColdFusion application is hosted in a data center it is good practice to ask about the levels of HA-redundancy. In particular you should know what their Service Level Agreement (SLA) states. For instance, if a router or switch should fail, how long will it take to be replaced?

Failover for a web application at the hardware level.

Figure 1. Failover for a web application at the hardware level.

Load-Balancing – In load balancing, cluster members are added to enable the application as a whole to handle more users. Typically you will want the load to be distributed evenly around all cluster members. There are several methods or algorithms for load balancing that are used to allocate the load.

The round robin algorithm cycles each request from each user from server to server. As mentioned above, in ColdFusion Enterprise an instance is equivalent to a server, so this concept applies to ColdFusion instances also.

The round robin algorithm for load balancing

Figure 2. The round robin algorithm for load balancing

If you are using the Session scope in your ColdFusion application it is not ideal to have users cycling from server to server with each request because they will lose their session information. In this case it is better to keep a user on a particular server once they are assigned there. You can do this by enabling sticky sessions (See Figure 3).

Figure 3. Sticky sessions in round robin load balancing

In my experience, round robin with sticky sessions is the most effective algorithm as there is a fairly well balanced distribution of load and the chance of a user losing their session is minimized. The only time that would happen is if one server (instance) were to fail completely.