Developer

ColdFusion is scalable

Yes, ColdFusion is a viable option for your next project. The latest version provides many features to address scalability concerns. Read this article to learn more.


A popular misconception is that ColdFusion is not scalable. As a certified ColdFusion developer, I take this claim personally. This article explores many facets of ColdFusion and, at the same time, discounts the frivolous claims regarding ColdFusion’s scalability.

What is scalability?
Scalability means the ability to respond to an increased server load in a linear fashion (see Figure A).

The latest release of ColdFusion (version 5) is 1.5 to 4.5 times faster than its predecessor, making it more usable and faster than any previous releases right out of the box. ColdFusion Server is sold in two versions: Professional and Enterprise. The Enterprise edition ships with built-in software load-balancing capabilities and a more robust Verity search engine. The load-balancing features allow multiple ColdFusion servers to work together in a server farm, or clustered environment, adding scaling capabilities. These features include ClusterCats, round-robin DNS, hardware load-balancing, server probes, and more.

Figure A
The concept of linear scalability


ClusterCats
ClusterCats is a technology that Allaire bought from a company called Bright Tiger and incorporated into the Enterprise Edition. It's a separate application installed off the CD. It basically puts a "bug" on each server, allowing them to talk to each other and exchange availability information at specified intervals. With ClusterCats, the servers work together to perform the task a load balancer would in a hardware load-balanced configuration.

ClusterCats offers load balancing without the need for expensive hardware load-balancing equipment. This solution works great for smaller businesses that may not have the budget for a hardware-based solution but need to ensure scalability.

ClusterCats allows numerous ColdFusion servers to work together in a server farm. At some point, more servers offer less and less scaling capacity; but that number is a matter of perspective, depending on your feeling for where the resource usage threshold falls.

Round-robin DNS
Round-robin works on a rotating basis: One server IP address is handed out and then moves to the back of the list; the next server IP address is handed out, and then it moves to the end of the list, and so on, depending on the number of servers being used. This process works in a looping fashion.

Using round-robin DNS, all servers respond to the same DNS entry. Each server communicates with other servers relaying its current load. Should a server experience a higher load than preferred, it will stop receiving new requests until its load falls below the predefined threshold. This predefined threshold can be anywhere from 1 percent to 99 percent of available server resources. It is up to the network or systems administrator to determine what load will be the trigger. The administrator can determine at what threshold a server begins to slow down and set its stop request level to just below that. This technique allows Web sites to scale as user requests increase. Servers can be added to the cluster with relative ease, making a site easily and cheaply scalable.

Hardware load balancing
ColdFusion provides hardware load-balancing support. Hardware load balancing puts a (commonly Cisco) piece of hardware between user requests and a server farm. The load balancer divvies up requests based on server load. This new feature allows ColdFusion servers to interface directly with the Cisco Local Director product, making hardware load balancing even easier to implement and manage.

Figure B shows the ColdFusion Administrator screen for managing servers under a hardware load balancer. The administrator can remove a server from the hardware cluster simply by checking a box or can leave it in the cluster but restrict it from receiving any further requests. The screen also shows load percentage, server state, probes, and threshold percentage. This information helps administrators manage the scaling of a site from a single point.

Figure B
CFAS Admin screen


Server probes
Another feature of this version of ColdFusion is the server probe. Server probes can be of two types: default and custom. The default probe simply lets you choose a ColdFusion (CFM) file to view, search for a particular string or value, and react in a specified way should the probe return false. When a probe returns a negative response, it can restrict requests from the hardware load balancer, send an e-mail, restart the ColdFusion service, or log the event in the event log. This functionality allows the ColdFusion server, in conjunction with the hardware load balancer, to take care of itself—handling increasing load and self-monitoring for issues.

The custom probe allows you to select applications that can be run as probes. Each has its own name and assigned task.

Other features
Another ColdFusion feature that lends to its ability to scale is its improved multithreaded processing system. As requests are received, the ColdFusion Application Server (CFAS) starts a new thread to process that request. When the request is fulfilled, the thread is closed, freeing up resources for future requests. This allows the CFAS to respond to more requests because resources are continually being allocated and released rather than allocated and held. Servers with multiple CPUs can spread a single request over each CPU, further stretching the available resources. (As with all things, you must keep in mind the point of diminishing returns; as more CPUs are added, the server itself loses resources so that it can manage the additional CPUs.)

ColdFusion keeps resource utilization low via Just In Time (JIT) compiling of requested pages. The first time a page is requested, the CFAS loads it into cache; subsequent requests are much faster, because they don’t rely on disk access. Not only does JIT compiling decrease response time from request to response but it also lightens the load on the server by accessing the hard drive less frequently. Cached pages are flushed after a predefined time to ensure that they don’t build up and that fresh copies are available.

Summing up
It is my hope that the myth that ColdFusion is not scalable can be laid to rest. ColdFusion scales as well as any other Web language (I have used) out there; just ask any of the companies using ColdFusion to support their online presence. An excellent place to find information on companies using ColdFusion is Forta.com.

Editor's Picks