Jul 12 2007

Unlocking the ColdFusion Black Box

New version will give developers and sysadmins server-monitoring features.

Although Adobe ColdFusion is a powerful application server, a shortcoming has been the difficulty of monitoring the inner workings and status of the ColdFusion server. The coming release, ColdFusion 8, lets developers and system administrators peer inside ColdFusion like never before.

ColdFusion, a Java-based application server that supports Web apps written in ColdFusion Markup Language (CFML), has long been a popular choice by agencies because of its rapid application development capabilities and because it integrates easily with Java and other technologies. It’s a useful coding environment for creating Web services when dealing with legacy government systems and code.

But the inability to easily monitor and manage the server side of the software has caused frustrations for developers trying to troubleshoot and fine-tune apps and for sysadmins responsible for keeping ColdFusion servers running at peak efficiency. With ColdFusion 8 — available as a public beta now and set for release late month this month or early next — developers can analyze apps during development, and sysadmins can monitor multiple production ColdFusion servers from within the Web-based administration console.

From the Inside Out

Adobe has added a server-monitoring feature to the ColdFusion Administrator, so users can access the new monitoring capabilities by clicking on a link. The monitoring function makes use of Adobe Flex technology to provide visually rich graphs and an intuitive, desktop-like user interface.

Heavier processes such as low-level monitoring, server profiling and memory tracking are disabled by default. Although useful, enabling these processes has an impact on server performance, so you should enable them only during development or when troubleshooting a production server.

A lot of useful information can be viewed without starting these resource-intensive processes, including:

  • average response time for requests graphed over time;
  • number of requests per second graphed over time;
  • Java Virtual Machine (JVM) memory utilization;
  • CFML templates that are throwing errors, including file path and line number details;
  • slow-running and large requests;
  • slow-running and large database queries;
  • database query cache details, including the total number of cached queries and their total size in RAM;
  • CFML template cache details, including the number of cached templates and the total size of the cache;
  • active applications and their memory use;
  • active sessions, including session identification, client Internet Protocol address and application name.

Once monitoring and profiling are enabled, additional information becomes available, including real-time data for active requests and threads, memory use and database activity. Having ready access to these statistics can take some of the guesswork out of developing efficient apps, troubleshooting slow-running production servers and performing capacity planning.

As a way of further letting developers and administrators unlock the ColdFusion black box, Adobe built its server-monitoring interface using the Server Monitoring Application Programming Interface, which is new to ColdFusion 8. It lets developers create their own monitoring tools using the API.

On Alert

ColdFusion 8 also lets administrators create alerts that will fire when a server begins to have trouble. There are four high-level categories of alerts:

  • unresponsive server alert, defined by the number of hung threads and/or the busy thread time in seconds;
  • slow server alert, defined by the response time threshold in seconds;
  • JVM memory alert, defined by the memory threshold of the JVM in megabytes;
  • timeout alert, defined by the number of threads that have timed out within a specified number of seconds.

Alerts are configurable, and administrators can opt to receive them via e-mail at set thresholds. But the alerts can also trigger actions to avoid problems: threads can automatically be killed, new requests rejected and JVM garbage collection called, and in all cases, a snapshot of the server can be created and saved to disk. The server snapshot provides details about what was happening on the server when the alert was triggered. Sysadmins can also set policies to execute custom ColdFusion code as part of the alert process, using a ColdFusion Component.

Prior to this release, performance tuning and debugging a ColdFusion app was often a hit-or-miss proposition, with far too many unanswered — and, in some cases, unanswerable — questions.

To download the public beta and read a users’ forum, go to Adobe Labs’ site at labs.adobe.com/technologies/coldfusion8. To learn about Flex technology, go to www.adobe.com/products/flex.