Server Monitoring - Server Monitor

Real-time performance monitoring and system health dashboard

Overview

The Server Monitor provides real-time visibility into ColdFusion server performance and health. It displays live metrics for memory usage, active requests, thread activity, query execution, and system resources. This tool is essential for diagnosing performance issues, identifying bottlenecks, and ensuring optimal server operation.

The Server Monitor must be enabled in the monitoring settings before it can collect and display performance data. Once enabled, it continuously tracks server activity and provides instant feedback on system health.

Monitoring Dashboard Sections

The Server Monitor dashboard is organized into several key sections providing comprehensive system visibility.

System Overview

PurposeHigh-level summary of server health and performance
Metrics DisplayedServer uptime, total requests processed, current request count, average response time
Update FrequencyReal-time (configurable refresh interval)
Key Indicators:
  • Green status indicates healthy operation
  • Yellow warnings suggest elevated resource usage
  • Red alerts indicate critical issues requiring immediate attention

Memory Metrics

PurposeMonitor JVM heap and non-heap memory usage
Metrics DisplayedTotal memory, used memory, free memory, memory utilization percentage
Critical Thresholds70%: Warning threshold
85%: Critical threshold
95%+: Immediate action required
Warning: Memory usage consistently above 85% indicates insufficient heap size or potential memory leaks. Monitor GC activity and consider increasing JVM heap or optimizing application code.

Active Requests

PurposeView all currently executing requests in real-time
Information ShownTemplate path, execution time, IP address, session ID, query string, thread ID
Actions AvailableView stack trace, terminate request, view request details
Use Cases:
  • Identify long-running requests consuming server resources
  • Detect infinite loops or hung threads
  • Analyze request patterns during load testing
  • Troubleshoot user-reported performance issues
  • Terminate runaway requests preventing server overload

Slow Running Requests

PurposeIdentify requests exceeding defined execution time thresholds
Default Threshold10 seconds (configurable in monitoring settings)
RecommendationWeb requests: 3-5 seconds
API requests: 5-10 seconds
Reports: 15-30 seconds
Performance Optimization:
  • Review slow requests regularly to identify optimization opportunities
  • Analyze query execution times and optimize database queries
  • Implement caching for frequently accessed data
  • Consider asynchronous processing for long-running operations

Database Query Monitoring

Track database query performance and identify optimization opportunities.

Active Queries

PurposeMonitor all currently executing database queries
Metrics DisplayedQuery SQL text, execution time, datasource name, template location, record count
Slow Query ThresholdDefault 1 second (configurable)
Query Optimization Tips:
  • Add indexes for frequently queried columns
  • Use query caching for repeated identical queries
  • Optimize JOINs and avoid SELECT * queries
  • Review execution plans for slow queries
  • Consider pagination for large result sets

Query Summary Statistics

PurposeAggregate statistics showing query performance patterns
Statistics ShownTotal queries executed, average execution time, maximum execution time, slow query count
Time PeriodsLast hour, last 24 hours, since server start

System Resource Monitoring

CPU Usage

Displays
Current CPU utilization percentage
Warning Level
Sustained usage above 80%

High CPU usage may indicate inefficient code, infinite loops, or insufficient server resources.

Thread Pool

Displays
Active threads, busy threads, available threads
Warning Level
90%+ threads busy

Thread exhaustion prevents new requests from being processed.

Request Queue

Displays
Number of queued requests waiting for processing
Warning Level
Queue depth greater than 10

Growing queue indicates server unable to keep up with request volume.

Session Count

Displays
Current active sessions, peak session count
Consideration
Memory usage per session

High session counts consume memory. Consider session timeout and clustering.

Monitoring Actions

Tools and actions available from the Server Monitor interface.

Terminate Request

PurposeForcibly stop a long-running or hung request
When to UseRequest stuck in infinite loop, consuming excessive resources, or unresponsive
Caution: Terminating requests should be a last resort. It may leave database transactions incomplete or files partially written. Always investigate root cause after termination.

View Stack Trace

PurposeSee the current execution stack for a running request
Use CasesIdentify where code is executing, debug infinite loops, analyze slow operations
Debugging Workflow:
  • Identify slow request in Active Requests view
  • Click to view stack trace
  • Locate the current line of code execution
  • Review surrounding code for performance issues
  • Check for database queries, file operations, or external service calls

Take Snapshot

PurposeCapture current monitoring data for later analysis
Snapshot ContentsAll active requests, memory usage, query statistics, system metrics
Use CasesDocument performance issues, compare load patterns, analyze historical trends
Best Practice: Take snapshots during peak load periods to establish performance baselines and identify capacity limits.

Interpreting Monitoring Data

High Memory Usage (85%+)

Symptom: Memory usage consistently high, frequent garbage collection, OutOfMemoryError
Investigation Steps:
  • Check for memory leaks in application code
  • Review session management and timeout settings
  • Analyze query result set sizes (large datasets)
  • Monitor application variables for excessive storage
  • Consider increasing JVM heap size if necessary
  • Enable verbose GC logging for detailed analysis

Request Queue Building Up

Symptom: Growing request queue, increased response times, timeout errors
Investigation Steps:
  • Identify slow-running requests in Active Requests view
  • Check database query performance
  • Review external service calls (APIs, web services)
  • Analyze CPU and memory resources
  • Consider increasing concurrent request limit if resources available
  • Implement caching to reduce processing overhead

Thread Pool Exhaustion

Symptom: All threads busy, new requests rejected or queued indefinitely
Investigation Steps:
  • Review active requests to identify blocking operations
  • Check for deadlocks or circular dependencies
  • Analyze synchronous operations that could be asynchronous
  • Optimize long-running database queries
  • Review request timeout settings
  • Increase thread pool size if appropriate

Programmatic Monitoring Access

Access monitoring data programmatically using CFML functions for custom dashboards and alerts.

Get Server Monitoring Data
<cfscript>
  // Get server monitoring data
  monitoringData = getApplicationMetadata();

  // Access memory metrics
  memoryUsed = monitoringData.memory.used;
  memoryMax = monitoringData.memory.max;
  memoryPercent = (memoryUsed / memoryMax) * 100;

  // Alert if memory exceeds threshold
  if (memoryPercent > 85) {
    // Send alert notification
    writeLog(
      file="monitoring-alerts",
      type="warning",
      text="High memory usage: #numberFormat(memoryPercent, '999.99')#%"
    );
  }

  // Get active request count
  activeRequests = getActiveRequestsCount();

  // Get thread pool information
  threadData = getThreadData();
  busyThreads = threadData.busyThreads;
  totalThreads = threadData.totalThreads;
  threadUtilization = (busyThreads / totalThreads) * 100;
</cfscript>
<!--- Get server monitoring data --->
<cfset monitoringData = getApplicationMetadata()>

<!--- Access memory metrics --->
<cfset memoryUsed = monitoringData.memory.used>
<cfset memoryMax = monitoringData.memory.max>
<cfset memoryPercent = (memoryUsed / memoryMax) * 100>

<!--- Alert if memory exceeds threshold --->
<cfif memoryPercent GT 85>
  <cflog
    file="monitoring-alerts"
    type="warning"
    text="High memory usage: #numberFormat(memoryPercent, '999.99')#%">
</cfif>

<!--- Get active request count --->
<cfset activeRequests = getActiveRequestsCount()>

<!--- Get thread pool information --->
<cfset threadData = getThreadData()>
<cfset busyThreads = threadData.busyThreads>
<cfset totalThreads = threadData.totalThreads>
<cfset threadUtilization = (busyThreads / totalThreads) * 100>
Custom Monitoring Applications:
  • Build custom dashboards displaying key metrics
  • Create automated alerts based on thresholds
  • Export monitoring data to external systems
  • Generate performance reports
  • Integrate with APM (Application Performance Monitoring) tools

Related Resources