Homebrewed ColdFusion Monitor Presentation Files

Recently I presented Homebrewed ColdFusion Monitoring to the Twin Cities CFUG and to the Online ColdFusion Meetup.  Both presentations went well and I've been asked to post my slides and example code. 

Attached to this post is a zip file that contains a PDF version of my slides and the example code plus the CFC I'm using to make a full featured monitoring application.  Please note that the code is for CF9 Enterprise.  There may be some things that won't work in earlier versions of CF or the standard edition of CF.
The recording for my live presentation is at http://experts.na3.acrobat.com/p34004904/
Enjoy and watch RIAForge.  I am planning to release this application to the ColdFusion Community for collaborative development.
Thank you to all that attended the presentations and for your wonderful feedback.

*UPDATE* - I just uploaded a new zip file with corrected code that actually works this time.

*Note: When I write little tools like this I'm usually writing it because there is something I absolutely need to see in order to complete another project. These little tools are not written as projects themselves and therefore may not be very pretty or as full featured as something that I was writing as a complete project. I just needed to get some code running that gave me back the data I needed to see. There are no warranties or promises. If you find is useful then great. If not, oh well. I know the code works on CF8 at the moment. It used to work on CF7, but I do not have a CF7 server anymore so I can not be certain.

Homebrewed ColdFusion Monitoring at the Online ColdFusion Meetup

I am excited to announce that I've been invited to speak on December 10th at 6pm CST about writing your own ColdFusion monitoring tools at the Online ColdFusion Meetup that is run by Charlie Arehart.  Below is part of the announcement and links to the Meetup site and meeting URL.  If you missed the presentation I gave at the TwinCites CFUG or just want to see it again, please join us for this Meetup.

Thank you,


What: "Homebrewed ColdFusion Monitoring ", with Wil Genovese
WHEN: Thurs. Dec 10, 6:00pm US ET (UTC/GMT-5)
MEETING URL: http://experts.acrobat.com/cfmeetup/
DURATION: Approx. 1 hour
Meeting will be recorded. URL will be posted after meeting at http://recordings.coldfusionmeetup.com
What time is the meeting in your timezone? (shows the time as US ET, and you can choose your city from the list offered to see what time that is in your own timezone)


Homebrewed ColdFusion Monitor at Twin Cities CFUG

Sitting at Chris & Rob's Chicago's Taste Authority in St. Paul, MN sipping a Goose Island 312 wheat beer, eating a couple of Chicago dogs and preparing my presentation for Homebrewed ColdFusion Monitoring.  I am happy to say the Twin Cities ColdFusion User Group (http://www.colderfusion.com) has asked me to talk about the ColdFusion Monitoring tools I've written and use at work. I've just accepted their invitation to present and I hope to see you there.

I will be updating these tools for ColdFusion 9 and I hope to have a basic standalone app ready to go by the time I give my presentation.  (The version I wrote for work is custom for our servers and not portable.)

The Twin Cities CFUG meets the first Wednesday of every month. This meeting will be on November 4th at 6:30 pm with pizza and socializing at 6:00pm.

See you there!

Scripting ColdFusion Restarts on Linux

A long time ago I wrote a bash shell script to monitor ColdFusion 7 and issue a restart if the CF server hung itself or was about to run out of memory.  I posted info on this script at House of Fusion back then. Today I am still getting requests for this script so I am finally posting the script files to my blog (which I didn't have back then).  

Repost from HOF:

My bash script does two things.  It checks a specified URL for a certain string to see if CF is still responsive and it also calls a cf script which reports back an integer that is the amount of free JVM memory left.

If a hang situation is detected the script will pause for a specified amount of time and


Which ColdFusion JVM Version

I've been reading more and more posts lately asking which version of the JVM should I use with ColdFusion x.xx?  This can be a big question, but it does get narrowed down a bit by the version of ColdFusion you are running and the known bugs in the JVM versions.

ColdFusion 7.xx

Lets start with ColdFusion 7.xx.  For years Macromedia and Adobe claimed that if you used anything other than the officially supported versions of the JVM you would not receive any support.  The problem is that the officially supported versions list never kept up with the updates from Sun.  This was a problem since Sun fixed many nasty bugs and performance issues, but Adobe still only  recognized the same old and buggy JVM versions.  So which version do I use?  When running version 7 of ColdFusion I won't use anything less than 1.4.2_13.  Anything before that, in my opinion and experience, is too buggy and unstable for high load applications.  The 'newest' version is 1.4.2_19 and unless there is a security update or something else very major, Sun won't be updating the 1.4 line any more. End of life was declared last October 30, 2008.  The last version I remember using was 1.4.2_17.


How to Tune the JVM Part 2

How to Tune the JVM for High Availability Coldfusion Servers: Part 2 Memory

In Part 1 we covered why you needed to tune your JVM and installing the updated JVM.  Now we are going to tune it for performance.  We are going to rewrite the java.args line to accomplish this.

First we are going to set the size in memory of your JVM.  On 32bit OS'es your going to be limited by the 32bit addressing more than the physical server memory.  We found that even though you should be able to address upto 2.1Gb of memory the maximum realistic stable JVM size is going to be around 1Gb.  Depending on the size of your application and the amount of data you store in memory you may never need a large amount of memory space.  So lets start building the “jvm.args” line.  Xmx and Xms are the max and min size of the JVM memory space.  These need to be the same number (did you back up your original file?).  In the example below we are setting the JVM memory space to be 1Gb.  The default setting as shipped from Adobe is 512m. Also note that much of the jvm.args line is path information.  We'll be saving that to put back on when we are done tuning.  Also I am assuming your server has plenty of physical memory is a multi-CPU/core beast.  If your server only has 1Gb of physical RAM then don't set your JVM heap to 1Gb. Better yet, upgrade your server. Memory is cheap.


How to Tune the JVM Part 1

How to Tune the JVM for High Availability Coldfusion Servers: Part 1

You tune your code, you tune your queries (I hope), you may even tune your guitar, but I bet you have never tuned your JVM.  

Why should you?

Your ColdFusion installation does not run directly on your server that's why.  ColdFusion runs in the Java Virtual machine.  Essentially the JVM is a virtual server (ie. the VM part of JVM) and if this virtual machine is not setup properly your ColdFusion installation may not perform as well as it should and may not even run at all. When speaking with key people from Adobe about the JVM I found out the JVM ColdFusion file (jvm.config) is shipped with a known to run basic configuration, but it is by no means ready to run under high demand situations.  For those saying, but 'Shouldn't ColdFusion do that?' or 'Why should I have to tune the JVM?'  The anwser is No, it shouldn't.  And you have to configure the OS of any computer you own in order to get it to run properly the same is true with any VM you may want to use including the JVM.  Remember the old days of DOS when you had to configure your config.sys file to get your brand new 8bit Soundblaster card to work?  Or maybe you've used a Linux distro. In either case you had to edit text configuration files to get everything just right. 

So, what happens when you don't tune the JVM.  You most likely already know and that's why you're reading this blog post. Ask yourself what happens when your business or website becomes successful and your server fails routinely?  You loose business that's what happens. If that isn't incentive enough I don't know what else to tell you.

What are the symptoms of an incorrectly tuned JVM?

They can be anything from slow performance, regular pauses to page processing to random and frequent JVM crashes.  The worst that can happen is your website won't even be able to stay running for a few minutes under load.  Typically I see posts with subjects like 'Help, ColdFusion keeps crashing' or 'My ColdFusion keeps hangimg'.  I'm here to tell you it's not ColdFusion.  It's either the JVM, the DB, network connections or your code.  Today we'll focus on the JVM.