• Home
  • /Posts Tagged 'admininstration'

Posts Tagged ‘admininstration’

Create a Windows Service for Flex Server

There are many reasons why you may want to add a JRun server instance to the Windows Services panel. I”ve found that its very handy on production machines in a cluster. If one fails, it recovers nicely without me having to help. Here is how I do it.

JRun provides an executable for managing its server instances called jrunsvc.exe. You can find it in the jrun_install_root\bin directory. Open a command line window to this directory and execute jrunsvc along with some of these options:

Option
Description
-install jrun_server [service-name [service-display [service-description]]]
Installs the JRun server as a Windows service. The Windows service name, Windows service display name, and Windows service description fields are optional. If a name contains spaces, use quotation marks.
The Mask:jrunsvc -install server_name “service display name” “service description”

The Example:

jrunsvc -install flexsamples “Flex Sample Applications Server” “Flex Samples”

-remove service-name
Removes the named Windows service, if you installed it using this utility. You can mark the service for deletion on system start.
-stop service-name
Starts the named service, if it is not already started.
-start service-name
Stops the named service, if it has started.

-console service-name
Runs the service from the console rather than from the Windows service Control Manager. Use this option for debugging.
-config path-to-jvm.config
Specifies a path to the JVM configuration file used by the Windows service.
Overrides the default, jrun_root\bin\jvm.config, to determine the JVM configuration.
-help
Lists all options.

This table is from the JRun Documentation with some modifications.

That is it! Now, when ever the server is restarted, the necessary Flex servers will start as well.

Feelin’ the Love From Your Logs

I recently had some datasource issues that I was able to figure out with a bit more feedback from the JRun logs.

First, for those of you who are not system admins, make sure you make a copy of the files before you modify them.

Now, there are a couple of XML files that you can modify that will provide a lot more detail of what is going on.

The CF datasources are stored in the jrun-resources.xml file located in {CFMX install}runtimeserversdefaultSERVER-INF. Locate the datasource in question and change the debugging node (<debugging>false</debugging>) of that element from false to true. This will tell JRun to log more information about this resource. Note: there a lot of other options available several of which you can equate to datasource options in the CF Admin.

Next, we want to modify the the actual logging service. You can do this with the jrun.xml file located in the same directory as jrun-resources.xml above.
Find the LoggerService in the jrun.xml file. Set the following two entries to “true”:
<attribute name=”debugEnabled”>false</attribute>
<attribute name=”metricsEnabled”>false</attribute>

A few lines down from these entries, you can separate the logs into separate files by making the following change:

<attribute name="filename">{jrun.rootdir}/logs/{jrun.server.name}-event.log</attribute>

to

<attribute name="filename">{jrun.rootdir}/logs/{jrun.server.name}-{log.level}</attribute>

By changing “event.log” to “{log.level}” it will create separate log files for each type of event. This allows you to narrow in on suspected problems a bit easier.

Finally, the logs produced can be found in {CFMX install}runtimelogs. Note: You will want to reverse these changes because they do cause a bit of overhead on the server.

CFSWITCH Performance Issue in CFMX 7

You will find this on a couple blogs, but since I”ve given presentations on ColdFusion performance since the Allaire days, I thought I should share.

My friends at webapper discovered an issue with CFSWITCH under load where the expression was a string.

In my presentations, I often encouraged the use of CFSWITCH over using if/elseif logic. This practice was a result of load testing applications with SilkPerformer. Under load, an application will show its true colors.

I still do recommend this practice, but now with a caveat. It has been found that string expressions in the CFSWITCH tag do not perform as well as numerics. Therefore, you should try to make these expressions numerics or evaluate if changing to CFIF/CFELSEIF would help your application.

Thanks Daryl for an excellent find!