Sep 22 2013

ColdFusion 10 Enhanced Performance Settings

Posted by Mike Brunt at 11:11 AM Web Servers | Performance | Java-JVM | ColdFusion | JRun-J2EE

By gathering information from others and using those settings and tweaking during load-testing we have arrived at a very good set of enhancements for ColdFusion 10, which now runs on Tomcat. Summarized these settings are: 

  • Upgrading the Java Virtual Machine (JVM) to jdk1.7.0_40. 
  • Changing to the Concurrent Mark Sweep (CMS) garbage collector adding the parallel new argument and passing enhanced arguments to those.
  • Adding extra attributes to the web server connector.

Here are the details.

Upgrading the JVM - 

Download the Java SE software development kit from Oracle and install.  On 64-bit Windows environments the default install location is C:\Program Files\Java\jdk1.7.0_40.  Archive the C:\ColdFusion10\{instance}\bin\jvm.config file (on a non-enterprise install {instance} will be named "cfusion".  Open the C:\ColdFusion10\{instance}\bin\jvm.config file and add the path to the jdk1.7.0_40 JVM commenting out the existing path as follows (note the forward slash separators)


java.home=C:/Program Files/Java/jdk1.7.0_40

We next need to copy a file from the jdk1.7.0_40 install to the ColdFusion 10 directory. Locate msvcr100.dll in the C:\Program Files\Java\jdk1.7.0_40\bin directory and copy it to C:\ColdFusion10\{instance}\bin\ directory. At this point, restart ColdFusion instance(s) to make sure all starts stably.

Changing The Garbage Collector -

Open the C:\ColdFusion10\{instance}\bin\jvm.config file and add these arguments at the beginning of the arguments line...

-XX:NewRatio=4 -XX:SurvivorRatio=8 -XX:+UseCompressedOops -Xss256k -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled -XX:+CMSScavengeBeforeRemark -XX:CMSInitiatingOccupancyFraction=68

Remove the current garbage collector -XX:+UseParallelGC

Add a start size for the Permanent Generation by adding this argument -XX:PermSize=128m (note this is a notional and safe number to find the number you actually need add these GC logging arguments...-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -verbose:gc -Xloggc:cfwhispererGC.log) At this point, restart ColdFusion instance(s) to make sure all starts stably.

Improving The Web Server Connector -

Archive the C:\ColdFusion10\config\wsconfig\1\ (note if you have many web sites connected to ColdFusion there will be multiple numbered directories here.) Add or modify the following settings ((on a non-enterprise install {instance} will be named "cfusion").




Next archive the C:\ColdFusion10\{instance}\runtime\conf\server.xml file. Open the C:\ColdFusion10\{instance}\runtime\conf\server.xml file and edit these settings so they read as follows...

<Connector port="8013" protocol="AJP/1.3" redirectPort="8446" tomcatAuthentication="false" maxThreads="500" connectionTimeout= "60000"></Connector>

At this point, restart ColdFusion instance(s) to make sure all starts stably.  This blog post has some very good information on these connector changes.

That's it, as I mentioned, in load testing these settings produced very favourable results, particularly in regards to full garbage collections (Full GC's) I noticed a great reduction in Full GC's yet overall heap behaviour was excellent.