Accessibility

ColdFusion Article

 

ColdFusion 8 server monitoring – Part 1: Using the Server Monitor in development


Table of Contents

Unlocking the "black box"

ColdFusion has long seemed a bit of a "black box," both to developers and administrators who've struggled at times to understand the cause of problems or even simply the impact of available choices, whether in CFML coding or in ColdFusion Server configuration. Finally, in ColdFusion 8, such folks can find most (if not all) the answers they seek by way of the new Server Monitor. Actually, the Server Monitor is more than just a monitor. It's both an interface and an administrative API (meaning you can write programs to access and respond to the monitoring data), and a handful of related functionality.

In fact, it's much more than just a tool that someone must watch incessantly to notice when graphs or charts change colors, reflecting some troublesome condition (though it does indeed do that). The Monitor includes features like alerts (triggered on a given condition, and responding automatically with a given action), as well as snapshots (an extensive logging of the current status of important factors that may help understand the cause of a problematic condition). The next two articles will introduce these various alternative features of the Server Monitor.

For most people, their first thought of the Monitor is the interface to view charts and graphs, so let's start by looking at that, and showing some fundamental uses of the interface, as well as an important point to note about various states of monitoring (which you can enable or not). Finally, I'll discuss some aspects of its use most suited to development activities.

Starting and using the Monitor

You can access the Monitor interface from the ColdFusion Administrator, using the option on the left navigation menu: Server Monitoring > Server Monitor > Launch Server Monitor. (You may notice a Multiserver Monitor option, which I'll discuss in part 3.) The Monitor interface is actually an Adobe Flex-based application, and you can launch it directly (without using the Admin console) by going to this URL in a browser (replace servername with your server's name): http://[servername]/CFIDE/administrator/monitor/launch-monitor.cfm.

The Server Monitor does, by default, require you to enter your Admin console password. If you defined multiple users, then different authorized users may have individual access to the Monitor.

The first page shown is the Overview or summary page, as shown in Figure 1. This shows a variety of charts and statistics about current execution of requests.

ColdFusion Server Monitor Overview page
Figure 1. ColdFusion Server Monitor Overview page

Note that the top two charts shown, Average Response Time and Requests Per Second, each have a drop-down option to change the displayed timeframe of information from All Data (reflecting all monitoring datapoints since the server started or the Monitor statistics were reset). You can set it to as little as the last minute to help you focus on the timeframe of data most important to you. The datapoints on the chart have pop-up information showing the exact time and value of a given point in the chart. (If you have not used the “start profiling” option, discussed in the next section, you will see no data on the first two charts, even if there are uses running requests on the server.)

The page also offers a Reports pane (below the 2 charts shown above), which shows current numerical values for various statistics (how many requests have had errors, have timed out, and so forth). Each report is also a drill down to more detail. If you double-click on a report name, such as Requests slower than nn seconds, you'll be taken to another screen showing a detailed drill-down for that report (typically showing a list of individual requests and their values), such as that in Figure 2.

A Report Summary Page (Requests slower than nn seconds)
Figure 2. A Report Summary Page (Requests slower than nn seconds)

Again, the report shown may have no data displayed, depending on the report you select and the “start” buttons selected. Also, in this example, I've modified the "slower than nn seconds" value on the report drill-down page to two seconds, simply to increase the display of data for these screen shots. You can select a value that's more important and meaningful for your data.

Note additionally that each line of that report is itself a drill-down. If you select a request line, you'll see additional detail about that particular request, including, in this case, tabs permitting you to view the value of variables for that request, including URL, session, Form, and CGI variables. If you have “start profiling” enabled (discussed in the next section), the bottom of the detail page shows the top 10 slowest tags or function calls in the request (see Figure 3).

A Report Detail Page (Slowest requests)
Figure 3. A Report Detail Page (Slowest requests)

You can return to the report drill-down page (listing all the requests for that given report) using the grid icon on the right side of the screen. Some reports will also have a chart icon next to the grid icon, offering charting of the data being displayed. You can also return to the starting Overview page using the Overview tab. Indeed, you may notice that when you select a drill-down report from the Overview page as in the steps above, you're actually taken to another section of the Monitor accessible through the Statistics tab, as shown at the top of the monitor display. That tab shows additional reports categorized under either “Request Statistics,” “Memory Usage,” “Database,” or “Errors.”

What it means to “Start Monitoring” (or not)

I've mentioned a couple of times already that some data will show up depending on whether you've enabled the start profiling option. Indeed, you may notice (on these screen shots and in your own display of the Monitor) that some of the charts or report data show no data (or a 0 value). While this could mean that there are no requests meeting the given criteria, it could also be that you simply have not enabled the monitoring option required to capture that data.

Notice at the top of the Monitor screen that there are three green buttons, each of which starts a particular form of monitoring. Even if you don't enable any of them, some of the reports and charts still track data. This is an important point to notice. In effect, these reports are "free" and incur no overhead to track. They reflect data to which ColdFusion inherently has access. There are many very useful reports in this class, including some data that are extremely useful and have never been available before. We'll focus on a couple types of data in this and the next article.

But many of the reports will not display meaningful data unless one of the "start" buttons is enabled. The options are:

  • Start Monitoring
  • Start Profiling
  • Start Memory Tacking

While the first option would seem key to any monitoring, again, that's not always the case. Many reports, including the Overview as shown in Figure 1, will reflect data even if none of the "start" buttons is enabled. According to Adobe, enabling both monitoring and profiling should incur only "minimal" overhead. The memory tracking option, however, can incur significant overhead and so should be used only for very short periods of time; perhaps not at all in production except when absolutely necessary. I'll introduce various reports and portions that rely on one or more of these options being enabled.