Performance Tuning ColdFusion Before the JVM

33
www.cfunited.com Performance Tuning ColdFusion Before the JVM Chris Peterson

description

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. - PowerPoint PPT Presentation

Transcript of Performance Tuning ColdFusion Before the JVM

Page 1: Performance Tuning ColdFusion Before the JVM

www.cfunited.com

Performance Tuning ColdFusion

Before the JVM

Performance Tuning ColdFusion

Before the JVM

Chris Peterson

Page 2: Performance Tuning ColdFusion Before the JVM

2www.cfunited.com

Chris PetersonChris PetersonChris PetersonChris Peterson

A. Started ColdFusion development with version 4.5 express

B. Background in SQL and network administration

C. Started working full time for Alagad in January 2009

Page 3: Performance Tuning ColdFusion Before the JVM

3www.cfunited.com

ObjectiveObjectiveObjectiveObjective

Discuss a holistic approach to identifying performance issues with ColdFusion applications, using a variety of tools and server observation.

Page 4: Performance Tuning ColdFusion Before the JVM

4www.cfunited.com

Don’t waste time JVM tuning a lemonDon’t waste time JVM tuning a lemonDon’t waste time JVM tuning a lemonDon’t waste time JVM tuning a lemon

Page 5: Performance Tuning ColdFusion Before the JVM

5www.cfunited.com

Identify the dominant consumerIdentify the dominant consumerIdentify the dominant consumerIdentify the dominant consumer

A. Listen to what your server is trying to tell you.

B. Enable slow page logging.

C. Obtain and Analyze a heap dump.

D. Review memory utilization with VisualVM and the VisualGC plug-in.

E. Investigate method calls with HPJmeter

F. Capture a SQL trace during peak production site load.

Page 6: Performance Tuning ColdFusion Before the JVM

6www.cfunited.com

Listen to what your server is trying to tell youListen to what your server is trying to tell youListen to what your server is trying to tell youListen to what your server is trying to tell you

Page 7: Performance Tuning ColdFusion Before the JVM

7www.cfunited.com

Reading the CPU graphReading the CPU graphReading the CPU graphReading the CPU graph

A. Green line = Total CPU utilization

B. Red line = Kernel / System usage

C. Green – Red = Application CPU usage

D. High kernel usage is often indicative of an I/O issue.

E. Waiting on I/O means your application code is not executing.

Page 8: Performance Tuning ColdFusion Before the JVM

8www.cfunited.com

Enable slow page loggingEnable slow page loggingEnable slow page loggingEnable slow page logging

A. Enable slow page logging

B. Process the server.log file with findslow.cfm (at www.cfcode.net) to get a report on the most-often used slow templates.

Page 9: Performance Tuning ColdFusion Before the JVM

9www.cfunited.com

Obtain and analyze a heap dumpObtain and analyze a heap dumpObtain and analyze a heap dumpObtain and analyze a heap dump

A. Obtain a heap dump –XX:+HeapDumpOnOutOfMemoryError VisualVM (Applications -> Heap Dump)

B. Review the heap dump in Netbeans or VisualVM

Page 10: Performance Tuning ColdFusion Before the JVM

10www.cfunited.com

VisualVM heap dumpVisualVM heap dumpVisualVM heap dumpVisualVM heap dump

Page 11: Performance Tuning ColdFusion Before the JVM

11www.cfunited.com

VisualVM Heap Dump (continued)VisualVM Heap Dump (continued)VisualVM Heap Dump (continued)VisualVM Heap Dump (continued)

Page 12: Performance Tuning ColdFusion Before the JVM

12www.cfunited.com

VisualVM and VisualGCVisualVM and VisualGCVisualVM and VisualGCVisualVM and VisualGC

A. Increase in ‘heap size after full GC’ each time is indicative of a memory leak.

Page 13: Performance Tuning ColdFusion Before the JVM

13www.cfunited.com

VisualGC outputVisualGC outputVisualGC outputVisualGC output

Page 14: Performance Tuning ColdFusion Before the JVM

14www.cfunited.com

Review methods with HPJmeterReview methods with HPJmeterReview methods with HPJmeterReview methods with HPJmeter

A. Capture method invocation data -Xrunhprof:cpu=times,cutoff=0 View metrics -> Method Call Count View metrics -> Call Graph Tree (CPU)

B. Identify lingering objects (memory leaks) -Xrunhprof:heap=all,cutoff=0 View metrics -> Residual Objects (Count)

Page 15: Performance Tuning ColdFusion Before the JVM

15www.cfunited.com

Example of HPJmeter method count listExample of HPJmeter method count listExample of HPJmeter method count listExample of HPJmeter method count list

Page 16: Performance Tuning ColdFusion Before the JVM

16www.cfunited.com

HPJmeter Residual Objects (count)HPJmeter Residual Objects (count)HPJmeter Residual Objects (count)HPJmeter Residual Objects (count)

Page 17: Performance Tuning ColdFusion Before the JVM

17www.cfunited.com

Example of HPJmeter Call Graph TreeExample of HPJmeter Call Graph TreeExample of HPJmeter Call Graph TreeExample of HPJmeter Call Graph Tree

Page 18: Performance Tuning ColdFusion Before the JVM

18www.cfunited.com

Its not always about the codeIts not always about the codeIts not always about the codeIts not always about the code

A. Network latency

B. Overloaded disk resources

C. Poorly configured database

D. Web server configuration

Page 19: Performance Tuning ColdFusion Before the JVM

19www.cfunited.com

Identify Network IssuesIdentify Network IssuesIdentify Network IssuesIdentify Network Issues

A. Identify overloaded nic with task manager.

B. Identify host issues with ping or pathping.

C. Identify network connections with netstat –a, or using Free Extended Task Manager.

D. More detailed investigation can be done with managed routers, or tools like WireShark (formerly Ethereal) to capture and analyze all network traffic.

Page 20: Performance Tuning ColdFusion Before the JVM

20www.cfunited.com

Wireshark – packet listingWireshark – packet listingWireshark – packet listingWireshark – packet listing

Page 21: Performance Tuning ColdFusion Before the JVM

21www.cfunited.com

Wireshark – packet detailWireshark – packet detailWireshark – packet detailWireshark – packet detail

Page 22: Performance Tuning ColdFusion Before the JVM

22www.cfunited.com

Ports Open – Free Extended Task ManagerPorts Open – Free Extended Task ManagerPorts Open – Free Extended Task ManagerPorts Open – Free Extended Task Manager

Page 23: Performance Tuning ColdFusion Before the JVM

23www.cfunited.com

Identify Overloaded Disk ResourcesIdentify Overloaded Disk ResourcesIdentify Overloaded Disk ResourcesIdentify Overloaded Disk Resources

Page 24: Performance Tuning ColdFusion Before the JVM

24www.cfunited.com

Identify a poorly configured databaseIdentify a poorly configured databaseIdentify a poorly configured databaseIdentify a poorly configured database

A. Capture a .trc file using SQL profiler with the ‘tuning’ profile selected

B. 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.

Page 25: Performance Tuning ColdFusion Before the JVM

25www.cfunited.com

Configure your SQL captureConfigure your SQL captureConfigure your SQL captureConfigure your SQL capture

Page 26: Performance Tuning ColdFusion Before the JVM

26www.cfunited.com

SQL trace in progressSQL trace in progressSQL trace in progressSQL trace in progress

Page 27: Performance Tuning ColdFusion Before the JVM

27www.cfunited.com

Starting the tuning advisorStarting the tuning advisorStarting the tuning advisorStarting the tuning advisor

Page 28: Performance Tuning ColdFusion Before the JVM

28www.cfunited.com

Tuning advisor in progressTuning advisor in progressTuning advisor in progressTuning advisor in progress

Page 29: Performance Tuning ColdFusion Before the JVM

29www.cfunited.com

Database Tuning Advisor resultsDatabase Tuning Advisor resultsDatabase Tuning Advisor resultsDatabase Tuning Advisor results

Page 30: Performance Tuning ColdFusion Before the JVM

30www.cfunited.com

In the end, it’s really all about user perceptionIn the end, it’s really all about user perceptionIn the end, it’s really all about user perceptionIn the end, it’s really all about user perception

A. Enable gzip compression of static site assets.

B. Combine CSS and JS files for faster loading.

C. Enable expiration tags for images, CSS, and javascript files for a future date.

D. Use a tool like ySlow to identify user-side issues. http://developer.yahoo.com/yslow/

E. Testing with tools like Jmeter can help you get a better user perspective on site performance. http://jakarta.apache.org/jmeter/

Page 31: Performance Tuning ColdFusion Before the JVM

31www.cfunited.com

ReviewReviewReviewReview

A. Your Coldfusion server does not work in a vacuum.

B. Identify your dominant consumer first, and address each until acceptable performance is achieved.

C. Its not always about the code.

D. User perception is the final word in web site performance measurement.

Page 32: Performance Tuning ColdFusion Before the JVM

32www.cfunited.com

LinksLinksLinksLinks

A. VisualVM - https://visualvm.dev.java.net/download.html(visualGC available in the plugin center)

B. Netbeans - http://www.netbeans.org/downloads/index.html

C. HPJmeter – http://www.hp.com/java

D. Free Extended Task Manager - http://www.extensoft.com/

Page 33: Performance Tuning ColdFusion Before the JVM

33www.cfunited.com

Questions?Questions?Questions?Questions?

A. Chris Peterson, Server Engineer

B. Alagad, Inc.

C. http://www.alagad.com/

D. [email protected]

E. (888) Alagad4 ext 369

F. Override11 (twitter)