Server Monitoring - Settings

Configure monitoring intervals, alerts, and snapshot behavior

Overview

The Server Monitoring Settings page controls how ColdFusion collects, stores, and reports performance data. Proper configuration of these settings is essential for effective monitoring without negatively impacting server performance. These settings determine what metrics are collected, how frequently data is gathered, and how alerts are triggered.

Performance Impact: Server monitoring consumes system resources. Overly aggressive monitoring intervals or tracking too many metrics can negatively affect application performance. Balance monitoring needs with performance requirements.

Enable Monitoring

Primary controls for activating the server monitoring system.

Enable Server Monitoring

PurposeMaster switch to enable or disable all server monitoring features
DefaultDisabled
RecommendationDevelopment: Enable for debugging and profiling
Production: Enable with appropriate thresholds
High-Traffic: Consider performance impact
Performance ImpactLow to Moderate (depends on monitoring frequency and metrics tracked)
When to Enable:
  • Troubleshooting performance issues
  • Capacity planning and load testing
  • Establishing performance baselines
  • Monitoring production health (with appropriate settings)
  • Debugging memory leaks or resource exhaustion

Enable Memory Tracking

PurposeTrack detailed memory allocation and usage patterns
DefaultEnabled (when monitoring enabled)
RecommendationEnable for memory leak detection and capacity planning
Metrics TrackedHeap usage, GC activity, memory allocation rates, memory pools
Use Cases:
  • Diagnosing OutOfMemoryError issues
  • Identifying memory leaks in application code
  • Right-sizing JVM heap allocation
  • Analyzing garbage collection patterns

Enable Profiling

PurposeCollect detailed performance profiling data for templates and functions
DefaultDisabled
RecommendationEnable selectively - only during performance analysis sessions
Performance ImpactModerate to High - can add 10-30% overhead
Performance Warning: Profiling has significant overhead. Only enable during active troubleshooting sessions. Do not leave enabled in production under normal circumstances.

Monitoring Intervals

Configure how frequently monitoring data is collected and updated.

Monitoring Data Refresh Interval

PurposeHow often monitoring data is collected and updated
Default5 seconds
Range1-60 seconds
RecommendationDevelopment: 3-5 seconds for responsive feedback
Production: 10-30 seconds to reduce overhead
Troubleshooting: 1-3 seconds for detailed analysis
Performance Trade-offs:
  • Lower intervals (1-3s): Higher overhead, more detailed data, faster issue detection
  • Higher intervals (15-30s): Lower overhead, less granular data, acceptable for normal monitoring
  • Balance based on monitoring needs and server load

Request History Size

PurposeNumber of completed requests to keep in history
Default10
Range1-100
Recommendation10-25 for most environments (higher values increase memory usage)
Memory Considerations: Each request stored consumes memory. Large history sizes on high-traffic servers can consume significant memory. Monitor memory usage when increasing this value.

Slow Request Tracking

Configure thresholds for identifying and tracking slow-running requests.

Slow Request Threshold

PurposeDefine execution time threshold for flagging slow requests
Default10 seconds
RecommendationWeb Pages: 3-5 seconds
API Endpoints: 5-10 seconds
Reports: 15-30 seconds
Batch Jobs: Custom based on requirements
ImpactRequests exceeding threshold appear in slow request monitoring view
Best Practice: Set threshold based on user experience expectations. Web pages should respond quickly (3-5s), while background jobs may have higher thresholds. Review slow request logs regularly to identify optimization opportunities.

Very Slow Request Threshold

PurposeHigher threshold for critically slow requests requiring immediate attention
Default30 seconds
Recommendation2-3x the slow request threshold
Use CaseTrigger alerts, escalate monitoring, identify potential infinite loops
Alert Configuration: Consider sending email/SMS alerts when requests exceed this threshold, as they may indicate serious performance or logic issues.

Log Slow Requests

PurposeWrite slow request details to log files for historical analysis
DefaultEnabled
RecommendationAlways enable to maintain historical performance data
Log Location{cf-home}/logs/monitoring.log
Log Analysis:
  • Review logs to identify recurring slow requests
  • Correlate slow requests with server load patterns
  • Use log data for performance trending over time
  • Export to analysis tools for visualization

Slow Query Tracking

Configure thresholds for identifying slow database queries.

Slow Query Threshold

PurposeDatabase query execution time threshold for slow query flagging
Default1 second
RecommendationOLTP Systems: 500ms - 1 second
Reporting: 2-5 seconds
Analytics: 5-10 seconds
ImpactQueries exceeding threshold flagged for review and optimization
Query Optimization Strategy:
  • Review slow queries regularly for optimization opportunities
  • Add appropriate indexes on frequently queried columns
  • Optimize JOIN operations and WHERE clauses
  • Consider query caching for repeated queries
  • Use database query execution plans to identify bottlenecks

Log Slow Queries

PurposeWrite slow query details to log files
DefaultEnabled
RecommendationEnable to track query performance over time
Logged InformationSQL text, execution time, datasource, template location, parameters

Snapshot Management

Configure automatic snapshot capture for preserving monitoring data at specific intervals.

Enable Automatic Snapshots

PurposeAutomatically capture monitoring data at scheduled intervals
DefaultDisabled
RecommendationEnable for production to maintain historical monitoring data
Snapshot FrequencyConfigurable (hourly, daily, custom intervals)
Snapshot Use Cases:
  • Compare performance across different time periods
  • Document performance before/after deployments
  • Establish performance baselines
  • Capacity planning and trend analysis
  • Historical troubleshooting of past incidents

Snapshot Retention Period

PurposeHow long to keep captured snapshots before automatic deletion
Default7 days
RecommendationDevelopment: 1-3 days
Production: 7-30 days
Compliance: Based on retention requirements
Storage ImpactLonger retention requires more disk space
Storage Management: Monitor snapshot storage location. Export important snapshots to external storage if long-term retention needed.

Maximum Snapshots

PurposeMaximum number of snapshots to retain before oldest deleted
Default10
Range1-100
Recommendation10-30 depending on snapshot frequency and retention period

Alert Configuration

Memory Usage Alert

Trigger Threshold
85% heap utilization
Recommendation
80-85% for production systems

Alert when memory usage reaches critical levels. Provides time to investigate before OutOfMemoryError occurs.

Request Queue Alert

Trigger Threshold
Queue depth exceeds 10
Recommendation
5-10 based on normal traffic patterns

Alert when requests are queuing, indicating server unable to keep up with demand.

Thread Pool Alert

Trigger Threshold
90% threads busy
Recommendation
85-90% thread utilization

Alert when thread pool approaching exhaustion. May require thread pool tuning or request optimization.

Very Slow Request Alert

Trigger Threshold
Based on very slow threshold setting
Recommendation
Enable for critical performance monitoring

Alert on exceptionally slow requests that may indicate infinite loops or serious performance issues.

Monitoring Best Practices

Development Environment

Recommended Settings:
  • Monitoring: Enabled for debugging
  • Refresh Interval: 3-5 seconds for responsive feedback
  • Profiling: Enabled during performance analysis
  • Slow Request Threshold: 3 seconds
  • Slow Query Threshold: 500ms
  • Snapshots: Manual only, 1-3 day retention
  • Alerts: Disabled or local logging only

Production Environment

Recommended Settings:
  • Monitoring: Enabled with performance-optimized settings
  • Refresh Interval: 10-30 seconds to minimize overhead
  • Profiling: Disabled (enable only during active troubleshooting)
  • Slow Request Threshold: 5 seconds for web pages
  • Slow Query Threshold: 1 second
  • Snapshots: Automatic hourly/daily, 7-30 day retention
  • Alerts: Email/SMS for critical thresholds
  • Log Slow Requests/Queries: Enabled

High-Traffic Environment

Recommended Settings:
  • Monitoring: Enabled with minimal overhead
  • Refresh Interval: 30-60 seconds
  • Profiling: Disabled except during off-peak troubleshooting
  • Request History: Small (5-10) to reduce memory
  • Snapshots: Less frequent (every 4-6 hours)
  • Consider: External APM tools with lower overhead

Programmatic Configuration

Configure monitoring settings via Admin API for automation and consistency across environments.

Configure Monitoring Settings via Admin API
<cfscript>
  // Create admin API object
  adminAPI = createObject("component", "cfide.adminapi.administrator");
  adminAPI.login("admin", "password");

  monitoringAPI = createObject("component", "cfide.adminapi.servermonitoring");

  // Enable monitoring
  monitoringAPI.setMonitoringEnabled(true);

  // Configure monitoring intervals
  monitoringAPI.setRefreshInterval(10); // 10 seconds
  monitoringAPI.setRequestHistorySize(20);

  // Configure slow request thresholds
  monitoringAPI.setSlowRequestThreshold(5); // 5 seconds
  monitoringAPI.setVerySlowRequestThreshold(15); // 15 seconds
  monitoringAPI.setLogSlowRequests(true);

  // Configure slow query thresholds
  monitoringAPI.setSlowQueryThreshold(1); // 1 second
  monitoringAPI.setLogSlowQueries(true);

  // Configure snapshots
  monitoringAPI.setAutoSnapshotEnabled(true);
  monitoringAPI.setSnapshotRetentionDays(14);
  monitoringAPI.setMaxSnapshots(30);

  // Configure alerts
  monitoringAPI.setMemoryAlertThreshold(85);
  monitoringAPI.setRequestQueueAlertThreshold(10);
  monitoringAPI.setThreadPoolAlertThreshold(90);

  writeOutput("Monitoring settings configured successfully");
</cfscript>
<!--- Create admin API object --->
<cfset adminAPI = createObject("component", "cfide.adminapi.administrator")>
<cfset adminAPI.login("admin", "password")>

<cfset monitoringAPI = createObject("component", "cfide.adminapi.servermonitoring")>

<!--- Enable monitoring --->
<cfset monitoringAPI.setMonitoringEnabled(true)>

<!--- Configure monitoring intervals --->
<cfset monitoringAPI.setRefreshInterval(10)>
<cfset monitoringAPI.setRequestHistorySize(20)>

<!--- Configure slow request thresholds --->
<cfset monitoringAPI.setSlowRequestThreshold(5)>
<cfset monitoringAPI.setVerySlowRequestThreshold(15)>
<cfset monitoringAPI.setLogSlowRequests(true)>

<!--- Configure slow query thresholds --->
<cfset monitoringAPI.setSlowQueryThreshold(1)>
<cfset monitoringAPI.setLogSlowQueries(true)>

<!--- Configure snapshots --->
<cfset monitoringAPI.setAutoSnapshotEnabled(true)>
<cfset monitoringAPI.setSnapshotRetentionDays(14)>
<cfset monitoringAPI.setMaxSnapshots(30)>

<!--- Configure alerts --->
<cfset monitoringAPI.setMemoryAlertThreshold(85)>
<cfset monitoringAPI.setRequestQueueAlertThreshold(10)>
<cfset monitoringAPI.setThreadPoolAlertThreshold(90)>

<cfoutput>Monitoring settings configured successfully</cfoutput>
Automation Benefits:
  • Consistent settings across multiple servers
  • Version-controlled configuration
  • Automated deployment and configuration management
  • Environment-specific settings (dev, staging, production)
  • Integration with infrastructure-as-code tools

Related Resources