330 likes | 393 Views
Performance Tuning ColdFusion Before the JVM. Chris Peterson. Chris Peterson. Started ColdFusion development with version 4.5 express Background in SQL and network administration Started working full time for Alagad in January 2009. Objective.
E N D
Performance Tuning ColdFusionBefore the JVM Chris Peterson
Chris Peterson • Started ColdFusion development with version 4.5 express • Background in SQL and network administration • Started working full time for Alagad in January 2009
Objective Discuss a holistic approach to identifying performance issues with ColdFusion applications, using a variety of tools and server observation.
Identify 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.
Reading 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.
Enable 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.
Obtain and analyze a heap dump • Obtain a heap dump • –XX:+HeapDumpOnOutOfMemoryError • VisualVM (Applications -> Heap Dump) • Review the heap dump in Netbeans or VisualVM
VisualVM and VisualGC • Increase in ‘heap size after full GC’ each time is indicative of a memory leak.
Review methods with HPJmeter • Capture method invocation data • -Xrunhprof:cpu=times,cutoff=0 • View metrics -> Method Call Count • View metrics -> Call Graph Tree (CPU) • Identify lingering objects (memory leaks) • -Xrunhprof:heap=all,cutoff=0 • View metrics -> Residual Objects (Count)
Its not always about the code • Network latency • Overloaded disk resources • Poorly configured database • Web server configuration
Identify 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.
Identify 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.
In the end, it’s 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/
Review • 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.
Links • 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/
Questions? • Chris Peterson, Server Engineer • Alagad, Inc. • http://www.alagad.com/ • cpeterson@alagad.com • (888) Alagad4 ext 369 • Override11 (twitter)