ColdFusion
8
Performance Tuning,
Multi-Instance
Management and
Clustering
Sven Ramuschkat
About
me
•
Sven Ramuschkat
•
CTO of Herrlich & Ramuschkat GmbH
•
ColdFusion
since
Version 3.1
•
Authorized
ColdFusion
Trainer since
1998
•
Also Specialist
for
Flash Media Server, Adobe Connect
and
LiveCycle
ES
•
www.richinternet.de
•
www.richinternet.de/blog
(English Blog)
Agenda
•
ColdFusion
8 Performance Gains
•
Best Settings
for
Performance
•
ColdFusion
Installation Options
ColdFusion
Performance with
Version 8
Adobe Observations
of CF8 over
CF7
•
Most applications
average
30-40% performance
gain
•
some
applications
3 or
4 times
better
•
Structure
manipulation
in CF 8 twice
as fast as CF 7
•
List manipulation
three
times
faster
•
CFSET more
than
four
times
faster
•
CFPARAM tag 35 times
faster
•
Date functions
about
6 times
as fast
•
Regular
expression
functions
more
than
twice
as fast
ColdFusion
8 now
deployed
atop
JDK 1.6
•
fixes some
past
problems, adds
some
new
features
•
adds
substantial performance
increases
•
Unfortunate
JVM bug
with
class
loading
•
Fall back to Java 1.5
•
Some
have
also updated
to 1.6 update 10
•
(1.6 update 10 unsupported
by
Adobe yet)
ColdFusion
Performance with
Version 8
Think
about
ColdFusion
64 Bit and Windows 2008 64-Bit:
•
No memory
heap
restrictions
anymore
•
As you can see, there are
performance gains of
around 0-15% in most of
the tags. This can be
attributed to the fact that
most of these tags are
computationally intensive
and perform better on
64-bit systems
ColdFusion
Performance with
Version 8
So an update to ColdFusion
8 is
a
must
from
a performance
Best settings
for
Performance
This
can
not
fix bad or
slow
code!
So always
start to optimize
your
code
CF-Administrator
–
Server Settings
–
Settings
“Enable Whitespace Management”
Setting
Tradeoff between extra server work and download speed
Can be expensive (up to a ~10% hit) on server side
Some webservers
offer HTTP compression
Squeezing whitespace out of .CFM files in batch can help
Please solve the whitespace problem inside your source code:
<cfsetting
enablecfoutputonly="true">
<cfoutput>Hello
World! </cfoutput>
CF-Administrator
–
Server Settings
-
Request
Tuning
Simultaneous Requests
Controls number of worker (request) threads created and able to service requests simultaneously
Single most important CF Admin setting (Def = 10)
Under the hood, this sets the JRun
“Active Handler Threads”
No magic formula, BUT:
Optimal CF5 setting may be too low for CFMX
Generally, start tuning at 3 per CPU
(i.e.: 6 on 2-way or 12 on 4-way)
Too high can cause heavy context switching
CF-Administrator
–
Server Settings
–
Caching
Template Cache Size
Use to cache compiled template Java bytecode
Where templates actually execute from
Memory considerations:
Consumption can be 3-10X ASCII template size
Can get OutOfMemory
conditions if set too high for the Java VM MaxHeapSize
on a very large site
CFMX = the NUMBER of templates
CF-Administrator
–
Server Settings
–
Caching
Trusted Cache
If “ON”, no check of template source file date/time
If “OFF”, will check and recompile templates if newly changed
Turn it “ON”
for production
Enabling “Trusted Cache”
Admin switch minimizes file system stat() calls
Includes Application.cfm
and OnRequestEnd.cfm
Can dramatically increase performance under load
Especially on shared network file systems
No server restart required
CF-Administrator
–
Server Settings
–
Caching
Some
people
have
been
noticing
dramatically
slower
application
startup
times
on ColdFusion
8 compared
to ColdFusion
MX 7.
The
answer
is
Java 6. For all the
other
performance
improvements
and
increased
functionality
in Java 6, it
introduced
a bug
in the
class
loader
that
causes
substantially
slower
class
loading.
A fix appears
to be
out now. JDK 6 update 10.
CF-Administrator
–
Server Settings
–
Caching
Number of Cached Queries
Sizing:
Default = 100, maximum is memory size
Make:
Big enough to fit a popular RS’s in memory
Small enough to keep out of swap space
NOT too big that you exceed Heap Size (OutOfMemory)
How much memory does each DB result set require?