cfmx performance settings


CFMX Performance Settings (JRun 50% CPU thread)
This checklist is an update for the one posted in the JRun CPU Consumption Pegged at 50% forums thread (http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=143&threadid=776647). I recommend testing these settings in an isolated environment before putting them into production. The list is compiled from notes of the CF product support incidents — results will vary. (Shout out to Daryl Banttari for some of the Java notes).

Disclaimer: I am offering these notes without any warranty from Macromedia

General
Optimize your server:
Re/Format your hard disks
Add more RAM (1GB/processor)
Add/Upgrade processor
Etc.
Check your logs ({servername}-err.log, {servername}-event.log, {servername}-error.log, etc.) — in cfroot\runtime\logs for CFMX Server configuration; in jrun.root\logs for CFMX for J2EE on JRun 4 configuration. What you are looking for are:
DB errors (e.g. connection errors, returned SQL state exceptions, etc.)
Java exceptions (e.g. java.lang.OutOfMemory, java.lang.illegalStateException, etc.)
Excessive “Connection reset” messages.
Install the ColdFusion MX 6.1 Updater — http://www.macromedia.com/support/coldfusion/downloads_updates.html#updater
Apply post-Updater hot fixes: http://www.macromedia.com/support/coldfusion/ts/documents/tn17883.htm#MX61U
Test your code for long running templates and eliminate bottlenecks. The “Connection reset” errors are caused by users clicking away before their original requests are returned. Increase performance and throughput by optimizing the code.
U>JVM Settings (jrunroot/bin/jvm.config or cfroot/runtime/bin/jvm.config)
Download and install the latest Java 1.4.2 SDK (1.4.2_06 at time of this posting) at http://java.sun.com/j2se/1.4.2/download.html. You need the J2SE SDK (software development kit) because it contains the server JVM, but you do not need the NetBeans bundle. J2SE 1.5 has been released but I have not used it.
Modify your JVM memory settings (e.g. max heap: -Xmx and max Perm Size: -XX:MaxPermSize). You want to tweak the sizes to prevent long and frequent garbage collection
Best practice JVM arguments (java.args section):
-server — specify this as the very first argument
-Xmx512m — Max Heap Size. Set as high as possible (1024 max limit on Windows) but I would not surpass 1/2 total RAM
-Xms256m — Min Heap Size. Set this higher than the default 64MB.Some like to set this equal to max size but I have seen start up issues because the jvm tries to grab too much memory too fast, causing CF/JRun to fail.
-XX:NewSize=64m — Creates a larger default Young generation
-XX:PermSize=32m — Creates a larger default Permanent generation size
-XX:MaxPermSize=128m — Sets the maximum Permanent generation size. Increase this as you increase max heap size.
-XX:+UseConcMarkSweepGC— Enables the Concurrent Mark/Sweep Collector for the tenured/old generation heap
+UseParNewGC — Young generation parallel garbage collector
Should replace the -XX:+UseParallelGC which is not compatible with the -XX:+UseConcMarkSweepGC argument
Only use in multi-processor machines; Do not use +UseParNewGC or -XX:+UseParallelGC use in single processor machines
-XX:+DisableExplicitGC — Use this option to disable the explicit garbage collection that is called during database pool clean up (CF/JRun bug #53346). This has been fixed in JRun 4 Updater 4 — which can be applied to CFMX for J2EE on JRun 4.
For garbage collection debugging you can enable the following: -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC

You can find information garbage collection tuning at http://java.sun.com/docs/hotspot/gc1.4.2/ Here’s an example of my java.args entry for a single processor, 1GB server:
java.args=-server -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Xmx512m -Xms256m -Dsun.io.useCanonCaches=false -Xbootclasspath/a:”{application.home}/../lib/webchartsJava2D.jar” -XX:MaxPermSize=128m -XX:NewSize=64m -XX:PermSize=64m -XX:+UseConcMarkSweepGC -Djavax.xml.parsers.SAXParserFactory=com.macromedia.crimson.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=com.macromedia.crimson.jaxp.DocumentBuilderFactoryImpl -XX:+DisableExplicitGC
jrun.xml Settings (cfroot/runtime/servers/default/SERVER-INF or jrun_root/servers/cf_instance/SERVER-INF)
Ensure the threadWaitTimeout for the ProxyService service is GTE the Request Timed Out CF Administrator setting.
For more information on this bug (55053) see TechNote 19351 at http://www.macromedia.com/support/coldfusion/ts/documents/request_timed_out.htm. For a more detailed explanation of Request Timeout and threadWaitTimeout see TechNote 19438 at http://www.macromedia.com/support/coldfusion/ts/documents/request_threadwaittimeout.htm.
Add the following lines to the SchedulerService service:
25
1000
20
180
600

CFMX Administrator Settings
Server Settings:
Simultaneous Requests: Generally keep this low for database (or third-party call) intensive sites, higher for pure CFML driven sites. Ten is usually a good high water mark.

Timeout Requests: This setting is also subjective but most sites set this between 8 and 30 seconds. Ensure you enable a reasonable value, and use the requestTimeout attribute of for individual templates that run longer.

Caching:
Enable Trusted Cache
Set Template Cache Size equal to the totoal number of CFML templates (cfc, cfm, etc.) on your server — including the Administrator.
For Production sites, you can enable Save Class Files.
Disable Cache web server paths
Judiciously set Cached Queries.

Client Variables:
Use a setting other than Registry. Our recommendation is an RDBMS: http://www.macromedia.com/support/coldfusion/ts/documents/tn17919.htm
Apply Client Variable hot fix:
Pre-CFMX 6.1 Updater: http://www.macromedia.com/support/coldfusion/ts/documents/client_purge_hotfix.htm
Post-CFMX 6.1 Updater: http://www.macromedia.com/support/coldfusion/ts/documents/client_purge_updater.htm
Debugging: Disable it in Production

Log Settings: Enable logging of slow pages and enter a time that is within 5 seconds less than the Timeout Request setting. This will log to the cfroot\logs\server.log and show you long running templates — your first area to look for bottlenecks.

U>JVM Settings (jrunroot/bin/jvm.config or cfroot/runtime/bin/jvm.config)
Download and install the latest Java 1.4.2 SDK (1.4.2_06 at time of this posting) at http://java.sun.com/j2se/1.4.2/download.html. You need the J2SE SDK (software development kit) because it contains the server JVM, but you do not need the NetBeans bundle. J2SE 1.5 has been released but I have not used it.
Modify your JVM memory settings (e.g. max heap: -Xmx and max Perm Size: -XX:MaxPermSize). You want to tweak the sizes to prevent long and frequent garbage collection
Best practice JVM arguments (java.args section):
-server — specify this as the very first argument
-Xmx512m — Max Heap Size. Set as high as possible (1024 max limit on Windows) but I would not surpass 1/2 total RAM
-Xms256m — Min Heap Size. Set this higher than the default 64MB.Some like to set this equal to max size but I have seen start up issues because the jvm tries to grab too much memory too fast, causing CF/JRun to fail.
-XX:NewSize=64m — Creates a larger default Young generation
-XX:PermSize=32m — Creates a larger default Permanent generation size
-XX:MaxPermSize=128m — Sets the maximum Permanent generation size. Increase this as you increase max heap size.
-XX:+UseConcMarkSweepGC— Enables the Concurrent Mark/Sweep Collector for the tenured/old generation heap
+UseParNewGC — Young generation parallel garbage collector
Should replace the -XX:+UseParallelGC which is not compatible with the -XX:+UseConcMarkSweepGC argument
Only use in multi-processor machines; Do not use +UseParNewGC or -XX:+UseParallelGC use in single processor machines
-XX:+DisableExplicitGC — Use this option to disable the explicit garbage collection that is called during database pool clean up (CF/JRun bug #53346). This has been fixed in JRun 4 Updater 4 — which can be applied to CFMX for J2EE on JRun 4.
For garbage collection debugging you can enable the following: -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC

You can find information garbage collection tuning at http://java.sun.com/docs/hotspot/gc1.4.2/ Here’s an example of my java.args entry for a single processor, 1GB server:
java.args=-server -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Xmx512m -Xms256 -Dsun.io.useCanonCaches=false -Xbootclasspath/a:”{application.home}/../lib/webchartsJava2D.jar” -XX:MaxPermSize=128m -XX:NewSize=64m -XX:PermSize=64m -XX:+UseConcMarkSweepGC -Djavax.xml.parsers.SAXParserFactory=com.macromedia.crimson.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=com.macromedia.crimson.jaxp.DocumentBuilderFactoryImpl -XX:+DisableExplicitGC
jrun.xml Settings (cfroot/runtime/servers/default/SERVER-INF or jrun_root/servers/cf_instance/SERVER-INF)
Ensure the threadWaitTimeout for the ProxyService service is GTE the Request Timed Out CF Administrator setting.
For more information on this bug (55053) see TechNote 19351 at http://www.macromedia.com/support/coldfusion/ts/documents/request_timed_out.htm. For a more detailed explanation of Request Timeout and threadWaitTimeout see TechNote 19438 at http://www.macromedia.com/support/coldfusion/ts/documents/request_threadwaittimeout.htm.
Add the following lines to the SchedulerService service:
20
1000
20
180
300

CFMX Administrator Settings
Server Settings:
Simultaneous Requests: Generally keep this low for database (or third-party call) intensive sites, higher for pure CFML driven sites. Ten is usually a good high water mark.

Timeout Requests: This setting is also subjective but most sites set this between 8 and 30 seconds. Ensure you enable a reasonable value, and use the requestTimeout attribute of for individual templates that run longer.

Caching:
Enable Trusted Cache
Set Template Cache Size equal to the totoal number of CFML templates (cfc, cfm, etc.) on your server — including the Administrator.
For Production sites, you can enable Save Class Files.
Disable Cache web server paths
Judiciously set Cached Queries.

Client Variables:
Use a setting other than Registry. Our recommendation is an RDBMS: http://www.macromedia.com/support/coldfusion/ts/documents/tn17919.htm
Apply Client Variable hot fix:
Pre-CFMX 6.1 Updater: http://www.macromedia.com/support/coldfusion/ts/documents/client_purge_hotfix.htm
Post-CFMX 6.1 Updater: http://www.macromedia.com/support/coldfusion/ts/documents/client_purge_updater.htm
Debugging: Disable it in Production

Log Settings: Enable logging of slow pages and enter a time that is within 5 seconds less than the Timeout Request setting. This will log to the cfroot\logs\server.log and show you long running templates — your first area to look for bottlenecks.

U>JVM Settings (jrunroot/bin/jvm.config or cfroot/runtime/bin/jvm.config)

Download and install the latest Java 1.4.2 SDK (1.4.2_06 at time of this posting) at http://java.sun.com/j2se/1.4.2/download.html. You need the J2SE SDK (software development kit) because it contains the server JVM, but you do not need the NetBeans bundle. J2SE 1.5 has been released but I have not used it.
Modify your JVM memory settings (e.g. max heap: -Xmx and max Perm Size: -XX:MaxPermSize). You want to tweak the sizes to prevent long and frequent garbage collection
Best practice JVM arguments (java.args section):
-server — specify this as the very first argument
-Xmx512m — Max Heap Size. Set as high as possible (1024 max limit on Windows) but I would not surpass 1/2 total RAM
-Xms256m — Min Heap Size. Set this higher than the default 64MB.Some like to set this equal to max size but I have seen start up issues because the jvm tries to grab too much memory too fast, causing CF/JRun to fail.
-XX:NewSize=64m — Creates a larger default Young generation
-XX:PermSize=32m — Creates a larger default Permanent generation size
-XX:MaxPermSize=128m — Sets the maximum Permanent generation size. Increase this as you increase max heap size.
-XX:+UseConcMarkSweepGC— Enables the Concurrent Mark/Sweep Collector for the tenured/old generation heap
+UseParNewGC — Young generation parallel garbage collector
Should replace the -XX:+UseParallelGC which is not compatible with the -XX:+UseConcMarkSweepGC argument
Only use in multi-processor machines; Do not use +UseParNewGC or -XX:+UseParallelGC use in single processor machines
-XX:+DisableExplicitGC — Use this option to disable the explicit garbage collection that is called during database pool clean up (CF/JRun bug #53346). This has been fixed in JRun 4 Updater 4 — which can be applied to CFMX for J2EE on JRun 4.
For garbage collection debugging you can enable the following: -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC

You can find information garbage collection tuning at http://java.sun.com/docs/hotspot/gc1.4.2/ Here’s an example of my java.args entry for a single processor, 1GB server:
java.args=-server -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Xmx512m -Xms256 -Dsun.io.useCanonCaches=false -Xbootclasspath/a:”{application.home}/../lib/webchartsJava2D.jar” -XX:MaxPermSize=128m -XX:NewSize=64m -XX:PermSize=64m -XX:+UseConcMarkSweepGC -Djavax.xml.parsers.SAXParserFactory=com.macromedia.crimson.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=com.macromedia.crimson.jaxp.DocumentBuilderFactoryImpl -XX:+DisableExplicitGC
jrun.xml Settings (cfroot/runtime/servers/default/SERVER-INF or jrun_root/servers/cf_instance/SERVER-INF)
Ensure the threadWaitTimeout for the ProxyService service is GTE the Request Timed Out CF Administrator setting.
For more information on this bug (55053) see TechNote 19351 at http://www.macromedia.com/support/coldfusion/ts/documents/request_timed_out.htm. For a more detailed explanation of Request Timeout and threadWaitTimeout see TechNote 19438 at http://www.macromedia.com/support/coldfusion/ts/documents/request_threadwaittimeout.htm.
Add the following lines to the SchedulerService service:
20
1000
20
180
300

CFMX Administrator Settings
Server Settings:
Simultaneous Requests: Generally keep this low for database (or third-party call) intensive sites, higher for pure CFML driven sites. Ten is usually a good high water mark.

Timeout Requests: This setting is also subjective but most sites set this between 8 and 30 seconds. Ensure you enable a reasonable value, and use the requestTimeout attribute of for individual templates that run longer.

Caching:
Enable Trusted Cache
Set Template Cache Size equal to the totoal number of CFML templates (cfc, cfm, etc.) on your server — including the Administrator.
For Production sites, you can enable Save Class Files.
Disable Cache web server paths
Judiciously set Cached Queries.

Client Variables:
Use a setting other than Registry. Our recommendation is an RDBMS: http://www.macromedia.com/support/coldfusion/ts/documents/tn17919.htm
Apply Client Variable hot fix:
Pre-CFMX 6.1 Updater: http://www.macromedia.com/support/coldfusion/ts/documents/client_purge_hotfix.htm
Post-CFMX 6.1 Updater: http://www.macromedia.com/support/coldfusion/ts/documents/client_purge_updater.htm
Debugging: Disable it in Production

Log Settings: Enable logging of slow pages and enter a time that is within 5 seconds less than the Timeout Request setting. This will log to the cfroot\logs\server.log and show you long running templates — your first area to look for bottlenecks.

view the actual article at
http://www.sargeway.com/blog/index.cfm?mode=entry&entry=27

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s