I am writing this tutorial because I know many people who still struggle when it comes to configure and manage ColdFusion 8 instances on a JRun server the proper way.
I had to learn it the hard way, and there was a lot of trial an error involved, so I decided to write this definitive guide.
I will use my current work as a use case, so you can understand exactly what the situation is, and hopefully re-use it in real life.
Basically we have ColdFusion 8 installed on each developer's computer, and in order to have everything separated, we have one ColdFusion instance per project, so we can save on resources, and can fine tune each of the instances (by changing each of the Java Virtual Machines separately) according to the application needs.
There is a few ways to accomplish this task, but lately I found that the easiest way if to use ColdFusion Administrator itself, and let it do all the work for you. Here is how I do it, assuming you have ColdFusion 8 multi-server configuration already installed:
If you got to this point, that means you've completed 95% of the task successfully, and you should already have an instance created.
Now, there is a "gotcha" to it, it's not yet considered as a Windows Service. And that is mainly because you told it not to back on step 9.
The reason why you did that, is because by allowing ColdFusion to create your Windows Service, you are also allowing it to create it as a native service. Meaning it will be using the Native Virtual Machine, and not the one you selected manually.
Why is that a problem? One may ask.
Basically if you allow it to happen, that means you have no control over your Virtual Machine, and can not fine tune settings like maximum and minimum memory, garbage collector timming and etc.
In other words you let windows manage it for you, and can not have any control whatsoever of what is happening with your application.
The solution then, is to create a jvm.config manually and turn your instance into a Windows Service manually. I have done this before, and I can assure you it is a very boring job, and you need to pay extra attention, otherwise your server will not even start-up, and you will lose hours trying to find out what is going on.
That is why I have put together a quick and dirty Adobe AIR app that does all the job for you, so you will only need to "tell" it what your configurations are, and it will create two files for you on your new instance's folder.
You then only need to execute a batch file (created "automagically" by my application), and your service will be created pointing to your newly generated jvm.conf file. Obviously, you can edit this jvm.conf file in order to do some fine tuning, but once the service is created, you only need to make your changes and restart the service, without the need of creating the service again.
It is a very basic application, as there is no reason to complicate. It does the job in a very clever way, and really saves you time and effort. I will be accepting suggestions in terms of functionality should anybody think there is anything else to be done. Here is the link to the project: http://jvmconfig.riaforge.org/
I hope you enjoyed it!