it from here

Download Report

Transcript it from here

Performance Tuning
ColdFusion
Before the JVM
Chris Peterson
www.cfunited.com
Chris 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
www.cfunited.com
2
Objective
Discuss a holistic approach to identifying
performance issues with ColdFusion
applications, using a variety of tools and
server observation.
www.cfunited.com
3
Don’t waste time JVM tuning a lemon
www.cfunited.com
4
Identify the dominant consumer
A.
B.
C.
D.
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.
E. Investigate method calls with HPJmeter
F. Capture a SQL trace during peak production
site load.
www.cfunited.com
5
Listen to what your server is trying to tell you
www.cfunited.com
6
Reading the CPU graph
A.
B.
C.
D.
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.
E. Waiting on I/O means your application code
is not executing.
www.cfunited.com
7
Enable 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.
www.cfunited.com
8
Obtain 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
www.cfunited.com
9
VisualVM heap dump
www.cfunited.com
10
VisualVM Heap Dump (continued)
www.cfunited.com
11
VisualVM and VisualGC
A. Increase in ‘heap size after full GC’ each time
is indicative of a memory leak.
www.cfunited.com
12
VisualGC output
www.cfunited.com
13
Review 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)
www.cfunited.com
14
Example of HPJmeter method count list
www.cfunited.com
15
HPJmeter Residual Objects (count)
www.cfunited.com
16
Example of HPJmeter Call Graph Tree
www.cfunited.com
17
Its not always about the code
A.
B.
C.
D.
Network latency
Overloaded disk resources
Poorly configured database
Web server configuration
www.cfunited.com
18
Identify 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.
www.cfunited.com
19
Wireshark – packet listing
www.cfunited.com
20
Wireshark – packet detail
www.cfunited.com
21
Ports Open – Free Extended Task Manager
www.cfunited.com
22
Identify Overloaded Disk Resources
www.cfunited.com
23
Identify 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 slowdowns, and even implement recommended
fixes.
www.cfunited.com
24
Configure your SQL capture
www.cfunited.com
25
SQL trace in progress
www.cfunited.com
26
Starting the tuning advisor
www.cfunited.com
27
Tuning advisor in progress
www.cfunited.com
28
Database Tuning Advisor results
www.cfunited.com
29
In 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/
www.cfunited.com
30
Review
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.
www.cfunited.com
31
Links
A. VisualVM https://visualvm.dev.java.net/download.html
(visualGC available in the plugin center)
B. Netbeans http://www.netbeans.org/downloads/index.ht
ml
C. HPJmeter – http://www.hp.com/java
D. Free Extended Task Manager http://www.extensoft.com/
www.cfunited.com
32
Questions?
A.
B.
C.
D.
E.
F.
Chris Peterson, Server Engineer
Alagad, Inc.
http://www.alagad.com/
[email protected]
(888) Alagad4 ext 369
Override11 (twitter)
www.cfunited.com
33