Migration - Upgrades

How to Monitor Performance After ColdFusion Migration

Contents show

Why Performance monitoring matters after a ColdFusion upgrade

Upgrading or migrating ColdFusion often delivers better Security, vendor support, and access to modern Features and Java runtimes. Those benefits only materialize when your application remains fast and reliable under real traffic. Effective post-Migration monitoring verifies that Performance baselines hold, exposes regressions early, and gives you the data to tune JVM, data sources, caching, and code paths without guesswork.


Prerequisites / Before You Start

  • Backups and rollback

    • Full filesystem backup of ColdFusion installation, custom JARs, scripts, cfusion instance(s), webroot(s), and server.xml.
    • Database backups and ability to restore to a point-in-time snapshot.
    • Exported ColdFusion Administrator settings: datasources, mail servers, Scheduled tasks, Security sandbox, Custom tags, request tuning, JVM arguments, logging settings.
    • Web server connector Configuration backups (IIS/Apache).
  • Version and Compatibility matrix

    • Target ColdFusion version and update level (e.g., 2018, 2021, 2023; with latest hotfixes).
    • Supported JDK for your ColdFusion version. ColdFusion 2021+ supports Java 11, and ColdFusion 2023 supports Java 11/17. Confirm with Adobe’s support matrix.
    • OS compatibility and required system libraries.
    • Web connector compatibility (wsconfig for IIS/Apache).
    • Driver compatibility for databases (e.g., Oracle, SQL Server, MySQL) and any message brokers or search engines (e.g., Solr, Elasticsearch).
  • Dependencies and external services

    • List of JDBC drivers and versions; validation queries for each DSN.
    • Third-party JARs, CFML libraries, and Custom tags.
    • Caching layers (Ehcache, Redis), session stores, and any CDN Configuration.
    • Scheduled tasks inventory and expected schedules.
    • Email servers, FTP endpoints, Payment gateways, SSO/LDAP, OAuth providers, and firewall rules.
    • Logging/observability stack (e.g., ELK/OpenSearch, Splunk, Datadog) and APM tools (FusionReactor, New Relic, AppDynamics, ColdFusion PMT).
    • SSL/TLS certificates and cipher requirements.
  • Baseline measurements (pre-Migration)

    • Capture throughput (RPS), average and p95/p99 response times, error rate, CPU, memory/GC, thread counts, heap usage by generation, datasource pool stats, and cache hit ratio.
    • Save 1–2 weeks of production metrics, including peak periods.
    • Define Service Level Objectives (SLOs) so you can validate the upgrade: e.g., “p95 < 450 ms, error rate < 0.5%.”
  • Access and environment

    • Staging environment that mirrors production (scale down is fine but keep topology equivalent).
    • Credentials and access to ColdFusion Administrator, web servers, databases, OS logs, and monitoring platforms.
    • Approved Maintenance and rollback windows.

Step-by-Step Migration and Monitoring Enablement

1) Inventory and enable baseline logging

  • Ensure access logs include request duration:
    • Tomcat (Adobe CF uses Tomcat): add an AccessLogValve with microseconds.
    • IIS/Apache: enable time-taken fields.
See also  How to Handle ORM Schema Changes in Migration

Example (Tomcat server.xml):

<Valve className=”org.apache.catalina.valves.AccessLogValve”
directory=”logs” prefix=”localhost_access_log” suffix=”.txt”
pattern=’%h %l %u %t “%r” %s %b %D %I’ />

  • %D = time in microseconds, %I = thread name/ID.

  • Turn on structured logging to your aggregator and tag logs with environment, version, and instance name.

  • If you have APM (e.g., FusionReactor), install the agent Pre-migration in staging and production to capture the “before” baseline.

2) Clone to staging and rehearse

  • Replicate CF Admin settings, DSNs, JVM args, and connector configuration.
  • Use sanitized database copies (or read-only replicas).
  • Run automated smoke/performance tests and compare with Pre-migration metrics.

3) Upgrade Java and ColdFusion

  • Install supported JDK and configure ColdFusion to use it by updating jvm.config (cfusion/bin/jvm.config).
  • Apply latest ColdFusion updates and security hotfixes.
  • If using multiple instances, update each instance independently and verify startup logs for errors.

4) Refresh JDBC drivers and DSNs

  • Update to the latest vendor-supported JDBC drivers.
  • Set validation queries and enable “Validate connections” on borrow to reduce stale connections.
  • Revisit connection pool sizes:
    • Start with Max Connections ~= (CPU cores * 2) or align with DB limits.
    • Idle Timeout 300–600s; Timeout 30–60s; Validation interval 30–60s.

5) Recreate/upgrade web connectors

  • Run wsconfig to register IIS/Apache connectors with the new CF instance(s).
  • Validate 32-bit vs 64-bit alignment and verify connector logs for handshake/timeout errors.

6) Scan code for deprecated/changed behaviors

  • Use Adobe ColdFusion Code Analyzer to flag Deprecated tags/functions and scope issues.
  • Common changes:
    • Strengthen use of cfqueryparam.
    • Avoid relying on implicit variable scope resolution; use explicit scopes (variables, arguments, request).
    • Migrate deprecated functions or tag attributes.
  • Test key code paths and templates.

7) Harden security and permissions

  • Apply the Auto-Lockdown tool where applicable.
  • Ensure ColdFusion runs under a least-privilege service account.
  • Restore sandboxing if previously used, and validate file access paths.

8) Revisit caches and session storage

  • Inspect template and object caches; verify size and eviction policies.
  • Consider externalizing sessions (e.g., Redis) for cluster consistency.
  • Rebuild caches after cutover during low-traffic windows or lazily with warmed endpoints.

9) Enable observability in the new stack

  • ColdFusion Performance monitoring Toolset (PMT) or APM:
    • Install/configure PMT server and register your CF node(s) from CF Admin Monitoring settings.
    • Configure sampling, thresholds, and data retention.
  • JMX and GC logs:
    • Enable JMX for safe, secured access.
    • Turn on GC logging and keep at least 7–14 days of rotating logs.
  • Log aggregation:
    • Forward CF logs (application.log, exception.log, coldfusion-out.log, scheduler.log) and web Server logs to your log platform.
  • Synthetic checks:
    • Schedule uptime and transaction monitors for core journeys.

10) Cutover plan and rollback

  • Announce Maintenance window; scale down traffic or route canary percentage to the new environment.
  • Validate key health metrics and SLOs before full cutover.
  • Keep a tested rollback path to the previous version, including data compatibility considerations.

How to Monitor performance After migration

Key metrics to track

  • User-facing

    • Response time: average, median, p95, p99.
    • Throughput (RPS) and request queue depth.
    • Error rate and top error classes.
    • SLA/SLO Compliance.
  • JVM and system

    • CPU, load, and context switches.
    • Heap usage by region (young/old), allocation rate.
    • GC pauses, frequency, and reclaimed bytes.
    • Thread counts: total, runnable, blocked; request thread pool utilization.
    • File descriptors/handles.
  • Data sources and external calls

    • JDBC pool: active, idle, wait count/timeouts.
    • Slow queries and top N by total time.
    • External HTTP calls: latency, timeouts, error codes.
    • Cache hit/miss ratio and eviction rates.
  • ColdFusion internals

    • Long-running requests and templates.
    • cfthread usage and queue size.
    • Scheduled task duration and failures.
    • Template cache and query cache performance.

Tooling options and when to use them

  • ColdFusion Performance monitoring Toolset (PMT)

    • Best for deep CF-specific telemetry, request traces, and template-level visibility.
    • Useful for identifying slow CFML templates, queries, and threads.
  • FusionReactor (or other APM: New Relic, AppDynamics, Datadog)

    • Cross-stack visibility, error analytics, transaction traces, JDBC insight, memory leak hunting.
    • FusionReactor is popular for ColdFusion and can capture stack traces and thread profiles with minimal overhead.
  • JMX/JFR and JVM tools

    • JFR (Java Flight Recorder) for low-overhead production profiling.
    • jcmd/jstat/jmap for one-off introspection and heap/GC analysis.
  • Log analytics platforms

    • Correlate access logs (time-taken) with application/exception logs.
    • Build dashboards and alerts on response times, error spikes, and unusual patterns.
See also  How to Upgrade ColdFusion License After Migration

Recommended layering (H5)

  • First mile: uptime + synthetic transactions.
  • Core: PMT or APM for requests, JVM, and DB.
  • Deep dive: JFR and GC logs for episodic regressions.
  • Breadth: logs and traces for correlation across tiers.

Build dashboards and alerts that match your SLOs

  • Dashboards

    • Requests by status code and endpoint with p50/p95/p99 latencies.
    • JVM heap/GC and thread pools on a single page for quick triage.
    • Top Slow queries and external calls ranked by total time impact.
    • CF-specific views: long-running templates and queued requests.
  • Alerts

    • p95 response time over threshold for N minutes (e.g., p95 > 450 ms for 5 min).
    • Error rate change detection (relative increase > 100%).
    • JDBC wait timeouts or pool exhaustion.
    • GC pause time > 2% of interval or single pause > 200 ms (tune for your SLOs).
    • Thread deadlock detection (via APM/JMX).

Instrument CFML for targeted visibility

Add lightweight timing around critical requests. Example in Application.cfc:

component output=”false” {

this.name = “MyCFApp”;
this.sessionManagement = true;

public boolean function onRequestStart(string targetPage) {
request._t0 = getTickCount();
return true;
}

public void function onRequestEnd(string targetPage) {
var duration = getTickCount() – (request._t0 ?: getTickCount());
// Log slow requests over 500 ms
if (duration > 500) {
writeLog(
type=”information”,
file=”slow-requests”,
text=”SlowRequest #duration=#duration#ms #url=#cgi.script_name#?#cgi.query_string#”
);
}
}

}

Use this temporarily in production to isolate regressions; then replace with APM/PMT rules.

Log-based monitoring patterns

  • Ensure Tomcat/IIS logs capture request time and upstream/request IDs for correlation.
  • Parse logs into your platform and derive p95/p99 per endpoint.
  • Enrich logs with Deployment version to spot changes linked to releases.

Load testing to validate capacity and headroom

  • Run load tests (e.g., JMeter, k6, Gatling) against staging and production (in a controlled window).
  • Test patterns:
    • Smoke and ramp (baseline).
    • Peak and soak (sustained load over hours).
    • Stress (beyond peak to find the knee point).
  • Compare new vs old baselines; confirm CPU/GC remain stable at target throughput.

Risks, Common Issues, and How to Avoid Them

  • JVM mismatch or unsupported JDK Features

    • Symptom: startup failure or random class loading errors.
    • Avoidance: align with Adobe’s supported JDK versions; test startup in staging; verify jvm.config path.
  • Connector misconfiguration (IIS/Apache)

    • Symptom: 500/503 errors, long tail latencies, dropped requests.
    • Avoidance: rebuild connectors with wsconfig, tune connection and request timeouts, and keep max packet size consistent.
  • JDBC driver changes affecting performance

    • Symptom: higher latency or connection leaks after upgrade.
    • Avoidance: use latest vendor drivers, enable validation queries, and watch pool metrics and DB wait states.
  • GC regressions due to new defaults

    • Symptom: sporadic latency spikes or elevated pause times.
    • Avoidance: enable GC logging; tune heap size and G1 parameters; assess allocation rate and object churn.
  • Session and cache behavior differences

    • Symptom: unexpected logouts or data eviction.
    • Avoidance: review session timeout and storage; warm caches or prebuild indexes.
  • Character encoding and timezone shifts

    • Symptom: corrupted characters, date/time misalignments.
    • Avoidance: explicitly set file.encoding, timezone, and DB connection collations; test with multilingual data.
  • Security lockdown side effects

    • Symptom: missing permissions for file or network access.
    • Avoidance: review sandbox rules, OS ACLs, and add allowlists for known paths/hosts.
  • File path case sensitivity and OS differences

    • Symptom: 404s or template not found on Linux.
    • Avoidance: normalize case and avoid OS-specific path assumptions.
  • Scheduled tasks and cron drift

    • Symptom: tasks skipped or overlapping.
    • Avoidance: check scheduler.log, add alerting for missed runs, and review timeouts.

Post-Migration Checklist / Validation Steps

  • Health and functionality

    • All instances start without errors; no repeating stack traces in coldfusion-out.log.
    • ColdFusion Admin pages load; DSN verification succeeds for each datasource.
    • Critical user journeys pass (login, checkout, search, File upload).
  • Performance baselines

    • Compare p95/p99 latency, throughput, and error rate with pre-migration baselines under similar traffic.
    • Ensure no increased long-tail latency for key endpoints.
  • JVM stability

    • Heap usage stabilizes; no continuous growth (possible leak).
    • GC logs show acceptable pause times and frequency; no full-GC storms.
    • Thread counts stable; no blocked/locked thread patterns.
  • Datasource health

    • No connection pool exhaustion; wait timeouts remain near zero.
    • Slow query list shrinks or matches baseline; indexes and query plans unchanged unexpectedly.
  • Logs and alerts

    • Access/application/exception logs flow into the aggregator with correct environment tags.
    • Alerts configured and tested: p95 latency, error rate, GC pauses, JDBC timeouts.
  • Security and Compliance

    • TLS versions and ciphers enforced; no mixed-content issues.
    • Auto-lockdown applied; file permissions least-privilege confirmed.
  • Scheduled tasks and integrations

    • All scheduled tasks executed at least once successfully post-cutover.
    • External integrations (email, SSO, Payment gateways) verified with test transactions.
See also  How to Migrate ColdFusion PDF Generation Services

Reference configurations and snippets

JVM options for GC logging (Java 11+)

In jvm.config or setenv script

-Xms4g
-Xmx4g
-XX:+UseG1GC
-Xlog:gc*,safepoint:file=/opt/coldfusion/logs/gc-%t.log:time,uptime,level,tags:filecount=14,filesize=50m
-XX:MaxGCPauseMillis=200
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/opt/coldfusion/logs/heapdumps

Enable secure JMX (example; adjust for your security posture)

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.rmi.port=9010
-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.ssl=true
-Djava.rmi.server.hostname=YOUR_HOSTNAME

Provide a password file and access file; allow only monitoring users via firewall/VPN.

Access logging with request time

  • Tomcat (server.xml):

<Valve className=”org.apache.catalina.valves.AccessLogValve”
directory=”logs” prefix=”access” suffix=”.log”
pattern=’%h %l %u %t “%r” %s %b %D “%{User-Agent}i” “%{X-Request-ID}i”‘/>

  • IIS: add “time-taken” and a correlation ID header to your logging fields.

ColdFusion Package Manager (CF 2021+)

If your app uses optional modules (e.g., PDF, ORM), install via cfpm to keep environments consistent:

cfpm.bat install pdfg orm spreadsheet
cfpm.sh list

Quick JFR session for a live node

jcmd JFR.start name=post_migration duration=10m filename=/opt/coldfusion/logs/jfr/post_migration.jfr settings=profile

Analyze with JDK Mission Control to identify hot paths or allocation spikes.


Simple metric-to-tool map

Metric Primary source Backup source Notes
p95/p99 latency Access logs, APM Load test tools Enable microsecond logging (%D)
Error rate APM, logs PMT Alert on absolute and relative spikes
Heap/GC GC logs, JFR APM/JMX Watch pause % and promotion failures
JDBC pool APM, PMT DB wait events Validate on-borrow; size within DB limits
Thread pools APM, JMX PMT Monitor queued/blocked threads
CF templates PMT FusionReactor Identify long-running templates

Practical Optimization tips after go-live

  • Tune request concurrency in CF Admin (Request Tuning). Start with Maximum Simultaneous Requests ~= CPU cores and adjust based on APM visibility into queuing and CPU saturation.
  • Reduce long GC pauses by right-sizing heap and taming allocation spikes. If allocation rate is high, review CFML hotspots and excessive object creation (e.g., large JSON serialization in loops).
  • Normalize JDBC pool sizes to the slowest tier (database). Oversized pools can increase contention and response times.
  • Cache rendered fragments or heavy query results with clear TTLs; verify cache hit ratio improves p95.
  • Review slowest endpoints by total time spent to maximize performance gains where users feel them most.

FAQ

How long should I run side-by-side monitoring before and after the upgrade?

Aim for at least one full business cycle, typically 1–2 weeks, to capture peak, off-peak, and batch windows. Compare like-for-like periods to account for seasonality.

Do I need both ColdFusion PMT and an APM like FusionReactor?

Not strictly, but they complement each other. PMT gives CF-specific insights (templates, cfthread), while APMs add cross-stack tracing, profiling, and richer alerting. Many teams run both with tuned sampling to keep overhead low.

What overhead should I expect from monitoring?

Well-configured PMT/APM agents typically add low single-digit percent overhead. Sampling, event capture, and log volume have the biggest impact. Start conservatively, measure, then increase detail where needed.

What if p95 latency increases but average remains stable?

Investigate tail latency: GC pauses, connection pool waits, external call timeouts, and Lock contention. Use JFR during the spike window and correlate with access logs and APM traces for the affected endpoints.

How do I detect a memory leak After migration?

Watch for steadily rising heap usage and increased GC frequency without returning to a steady state. Capture a JFR or heap dump when the process is “hot,” analyze dominators, and correlate with recent code/dependency changes.

About the author

Aaron Longnion

Aaron Longnion

Hey there! I'm Aaron Longnion — an Internet technologist, web software engineer, and ColdFusion expert with more than 24 years of experience. Over the years, I've had the privilege of working with some of the most exciting and fast-growing companies out there, including lynda.com, HomeAway, landsofamerica.com (CoStar Group), and Adobe.com.

I'm a full-stack developer at heart, but what really drives me is designing and building internet architectures that are highly scalable, cost-effective, and fault-tolerant — solutions built to handle rapid growth and stay ahead of the curve.