Published:
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.
In a previous post I talked about creating per instance jvm.config files for coldfusion for tuning the jvm and configuring monitoring of ColdFusion. Today I am going to discuss how to hook up a jvm monitor, but first lets discuss why we would want to do that.
ColdFusions Builtin Monitoring
The monitoring tools available in Coldfusion are extremely powerfull. They can give you detailed information on slow running requests, queries and application memory usage. They should always be your first point of call when you are seeing poor performance from your application. However the builtin monitoring has two flaws.
Corrupts the results
By turning on the different levels of monitoring you further increase the load on that instance of ColdFusion, this both slows the application (not good if you only have a single production machine to work with) and because it adds loads to the server this can confuse the data.
Not Deep Enough
In cases where you are seeing memory leaks where memory is being taken up and not being released even when nobody is using the application then the built in monitoring is probably not going to be enough. Yes you can see in you have extremely large sessions etc. but sometimes you need to look closer.
External Monitoring Tools
There are several external monitoring tools on the market. Some are free and some you have to pay for. One product I have used which is very powerful is FusionReactor. Its simple to use, detailed and external to ColdFusion so it has less impact on the results. However before paying out there are two very powerful free tools you can use to monitor Coldfusions jvm.
JConsole
JConsole is one of the monitoring tools that comes packaged with the latest JDK from sun/oracle. It does not come with Coldfusion so you need to download and install it. The executable is located in {JDK_HOME}/bin folder.
JVisualvm
JVisualVM is another good monitoring tool and like JConsole is also packaged in the latest JDK.
Connecting to the JVM
Whichever monitoring tool you choose you must be able to connect to the jvm. To do this you must assign a port on which the JMX can open a remote connection. To do this you must edit the jvm.config file.
Note: If you have a multi instance environment each instance of Coldfusion must have a unique port. For that reason you must have a separate jvm.config file for each instance in order to monitor them all at once (click here for more info).
To configure add the following arguments to the "java.args" entry in your jvm.config files. The jvm.config file will be located in your {coldfusion_install_dir}/bin folder.
Note: You must place these arguments on the same line and after the "-server" argument.
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=<a unique port number>
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
Restart your Coldfusion instances and start up your monitoring tool. You can then make a JMX connection to each CF instance using the assigned port number.
I will cover using the monitoring tools at a later date, or if your in a hurry you can read for yourself the sun/oracle documentation using the links above.
Reader Comments