Title: Performance Tuning ColdFusion Before the JVM
1Performance Tuning ColdFusionBefore the JVM
2Chris Peterson
- Started ColdFusion development with version 4.5
express - Background in SQL and network administration
- Started working full time for Alagad in January
2009
3Objective
- Discuss a holistic approach to identifying
performance issues with ColdFusion applications,
using a variety of tools and server observation.
4Dont waste time JVM tuning a lemon
5Identify the dominant consumer
- Listen to what your server is trying to tell you.
- Enable slow page logging.
- Obtain and Analyze a heap dump.
- Review memory utilization with VisualVM and the
VisualGC plug-in. - Investigate method calls with HPJmeter
- Capture a SQL trace during peak production site
load.
6Listen to what your server is trying to tell you
7Reading the CPU graph
- Green line Total CPU utilization
- Red line Kernel / System usage
- Green Red Application CPU usage
- High kernel usage is often indicative of an I/O
issue. - Waiting on I/O means your application code is not
executing.
8Enable slow page logging
- Enable slow page logging
- Process the server.log file with findslow.cfm (at
www.cfcode.net) to get a report on the most-often
used slow templates.
9Obtain and analyze a heap dump
- Obtain a heap dump
- XXHeapDumpOnOutOfMemoryError
- VisualVM (Applications -gt Heap Dump)
- Review the heap dump in Netbeans or VisualVM
10VisualVM heap dump
11VisualVM Heap Dump (continued)
12VisualVM and VisualGC
- Increase in heap size after full GC each time
is indicative of a memory leak.
13VisualGC output
14Review methods with HPJmeter
- Capture method invocation data
- -Xrunhprofcputimes,cutoff0
- View metrics -gt Method Call Count
- View metrics -gt Call Graph Tree (CPU)
- Identify lingering objects (memory leaks)
- -Xrunhprofheapall,cutoff0
- View metrics -gt Residual Objects (Count)
15Example of HPJmeter method count list
16HPJmeter Residual Objects (count)
17Example of HPJmeter Call Graph Tree
18Its not always about the code
- Network latency
- Overloaded disk resources
- Poorly configured database
- Web server configuration
19Identify Network Issues
- Identify overloaded nic with task manager.
- Identify host issues with ping or pathping.
- Identify network connections with netstat a, or
using Free Extended Task Manager. - More detailed investigation can be done with
managed routers, or tools like WireShark
(formerly Ethereal) to capture and analyze all
network traffic.
20Wireshark packet listing
21Wireshark packet detail
22Ports Open Free Extended Task Manager
23Identify Overloaded Disk Resources
24Identify a poorly configured database
- Capture a .trc file using SQL profiler with the
tuning profile selected - Run your .trc file through the database tuning
advisor (available on SQL Standard or higher) and
quickly locate database slow-downs, and even
implement recommended fixes.
25Configure your SQL capture
26SQL trace in progress
27Starting the tuning advisor
28Tuning advisor in progress
29Database Tuning Advisor results
30In the end, its really all about user perception
- Enable gzip compression of static site assets.
- Combine CSS and JS files for faster loading.
- Enable expiration tags for images, CSS, and
javascript files for a future date. - Use a tool like ySlow to identify user-side
issues. http//developer.yahoo.com/yslow/ - Testing with tools like Jmeter can help you get a
better user perspective on site performance.
http//jakarta.apache.org/jmeter/
31Review
- Your Coldfusion server does not work in a vacuum.
- Identify your dominant consumer first, and
address each until acceptable performance is
achieved. - Its not always about the code.
- User perception is the final word in web site
performance measurement.
32Links
- VisualVM - https//visualvm.dev.java.net/download.
html(visualGC available in the plugin center) - Netbeans - http//www.netbeans.org/downloads/index
.html - HPJmeter http//www.hp.com/java
- Free Extended Task Manager - http//www.extensoft.
com/
33Questions?
- Chris Peterson, Server Engineer
- Alagad, Inc.
- http//www.alagad.com/
- cpeterson_at_alagad.com
- (888) Alagad4 ext 369
- Override11 (twitter)