Enhancing scalability requires the active monitoring of your production platform and methodical offline load testing of staging or quality assurance (QA) systems. Analysis of the gathered metrics will show you problem areas to address to increase performance.
Promoting reusable resources to minimize system overhead enhances scalability. Caching is your chief weapon in helping your ColdFusion Server scale. Utilizing the ColdFusion caching mechanisms and code optimizations discussed earlier in this book will help improve performance. Your goal in making these enhancements is to achieve perfect scalability, or linear scalability.
Linear Scalability Explained
There are two ways to define linear scalability:
System and resource overhead directly affect an application server's linear scalability. Again, caching enables reuse of previously processed templates and previously allocated resources. This eliminates the system overhead of reprocessing and reallocating the templates and resources to serve subsequent requests.
Resource management involves analyzing the overhead of all the resources that may constrain system performance. This includes processors, random-access memory (RAM), hard drives, network capacity, and so on. It is important to understand the overhead incurred with additional resources. For example, adding an additional processor to a single-processor Windows 2000 server increases processing power at the cost of additional overhead incurred by the operating system to manage the additional processing power. Similarly, adding additional servers to your cluster will not improve performance if your network bandwidth is the bottleneck.
To help you understand what resources are being consumed while you are performing your load testing, you can use two tools that are provided by Macromedia. The first is the built-in performance monitor counters for ColdFusion Server. If you've never loaded these counters, you'll want to do so prior to beginning your load testing so that you can monitor the health of the ColdFusion Server and its resource consumption as you test.
The performance monitor counters can be found in the CFUSIONMX/BIN directory on your server. Double-click the ColdFusionMXServer.pmc file and the counters will automatically be loaded into the PerfMon window for you.
On a UNIX system, the same information provided through the PerfMon counters can be obtained using the CFSTAT utility. Note that the CFSTAT utility can also be used on Windows systems, although the information is the same as you would obtain through PerfMon.
The CFSTAT utility can also be found in the CFUSIONMX\BIN directory, and it can be used at the command line with the following syntax:
where n is the number of seconds you want the utility to wait before refreshing its data.
Both utilities give you insight into how the ColdFusion Server itself is performing while you are doing your load testing.
It is paramount that you understand how the overhead of system resources affects your application's linear scalability. The only way to quantitatively measure the effectiveness of your efforts to enhance scalability relative to system resource overhead is through load testing.