Application deployed on Network/Remote Path – Identifying Network Latency – Improve Performance

Many a time, ColdFusion application code is deployed on a network path when your ColdFusion deployments are of large-scale and mandated to use network paths.

After setting up the server for the first time, if there is any performance hit, as the first thing you would want to cross-check few things. One of the things to determine is if there is any network latency.

Though you would have got same network within your organization same as earlier, your OS version also would have changed.

Follow the steps below to see if the performance hit is due to network latency-

When the server is under moderate or full load(with at least 8-10 requests under process), take 2 or 3 thread dumps with 30 seconds interval.

It is not appropriate to take thread dump when the server has negligible load and anlyze that as there may not be any in-process requests.

If you are not sure how to take thread dump, you can simply follow the following blog.

( Taking Thread Dumps From ColdFusion Server Programmatically )

Open the thread dump file:

Under moderate or full load server conditions, if you see more than 5-8% of running ColdFusion threads containing “WinNTFileSystem” in the thread’s stack trace –> It means that there is lot of time being spent in trying to resolve the application file paths.

Following are the sample threads having WinNTFileSystem in its dump.

"ajp-bio-8014-exec-6861" Id=13898 in RUNNABLE
 java.lang.Thread.State: RUNNABLE
 prio=5 blockedtime=28963 blockedcount=6819 waitedtime=421762 waitedcount=115
    at java.io.WinNTFileSystem.getBooleanAttributes(Native Method)
    at java.io.File.isFile(File.java:876)

 

"ajp-bio-8014-exec-6861" Id=13898 in RUNNABLE (running in native)
 java.lang.Thread.State: RUNNABLE
 prio=5 blockedtime=28961 blockedcount=6814 waitedtime=421762 waitedcount=115
    at java.io.WinNTFileSystem.canonicalize0(Native Method)
    at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:414)
    at java.io.File.getCanonicalPath(File.java:618)

 

(Note: ColdFusion threads can be identified by the name starting with "ajp-" )

For Example, if there are 50 threads with thread name starting "ajp-bio-" in the thread dump, if you see WinNTFileSystem in more than 2-3 threads, it is the time you start looking at minimizing the network latency.

 

Once you know there is latency, you would want to know how much is the latency when compared to the application existing locally.

Created a very basic network latency test program to validate this.

You can take the jar from here.

And run it from command prompt as follows:

> C:ColdFusion11jrebinjava -jar <Path of NetworkPathsTest.jar> <Network or Local Directory Path >

If the network path (Ex:- \orgserverd$) is accessible only to the ColdFusion service user, open command prompt as that user ( runas /user:<cfserviceaccount domainname>cfserviceusername CMD )

 

Examples:

Path Arguments can be one or more. More Path arguments is a good measure to see the difference clearly.

C:ColdFusion11jrebinjava -jar C:ColdFusion11NetworkPathTest.jar \orgserverd$deploycfm

C:ColdFusion11jrebinjava -jar C:ColdFusion11NetworkPathTest.jar \orgserverd$deploycfm \orgserverd$deploycfmapi

Try the same paths keeping the content same on the local machine and see the time differences.

For the same paths on local and remote, the difference in time should not be exponential.

These tests are to be performed on your ColdFusion server machine.

Once you have validations and found any latencies, it is the time to call for network optimization expertise.

 

 

ColdFusion 11 Migration Guide

We are happy to announce the
first release of Migration Guide for ColdFusion 11. This guide will help you,
to migrate your ColdFusion 9 and ColdFusion 10 servers to ColdFusion 11
seamlessly. This guide also gives a fair overview for migration of legacy
servers to the most recent and supported versions. This helps you understand
the various phases of migration, along with, how to use Code Analyzer. The Code
Analyzer reviews the CFML pages that you specify and informs you of any
potential compatibility issues and ensures a smooth migration.

We also tried to cover, few of
the common migration issues and possible solutions.

Here is the link to ColdFusion 11 Migration Guide and don’t
forget to visit the “Help and tutorials” section inside the guide.

We are open for your suggestions
and feedback.

Migrating CF Admin settings from ColdFusion 9 or 10 to ColdFusion 11

Since we have been getting lot of calls/queries around migration these days, I thought it would make sense to make a blog post on it. Now, since Migration is a very broad subject we need to keep in mind the Technology, Hardware, Operating System, Settings, Application Server, Web Server, Code compatibility.

In this article we will discuss 2 ways on how to migrate CF Admin settings from ColdFusion 9 or 10 to ColdFusion 11.

  1. Migrate via Car files
  2.      Migrate via migration wizard

Migrate via Car files:

ColdFusion archive files (.car) files can be generated and deployed only if both the version of ColdFusion are in enterprise edition. Out of all the differences between standard and enterprise edition, one of them is that you cannot create a .car file in standard edition (but note that generation of car files IS now available in ColdFusion 11 standard edition).

So, if you have ColdFusion 9 (or 10) Enterprise edition and ColdFusion 11 Standard or Enterprise edition you can migrate via these method. If you need to migrate from Coldfusion 9 Standard, see the final section, "Migrate via migration wizard".

To export your CF9 Admin settings (in ColdFusion 9 Enterprise), in the ColdFusion 9 admin page please go to packaging and deployment >> ColdFusion Archives. In the ColdFusion archives page you will find two options

         ·         Deploy an Existing Archive

         ·         Create an Archive

Now, since we are creating the archive file we will select create an archive option. On the Archive name option let us give a name say “test” and click on create. Once the archive is created it will be listed under Current Archive Definition List. In the actions bar please click on the pen icon (refer to the image below):

 

When you click on the icon, a pop up page will open up where you can select all the settings that you want to migrate (refer to the image below)

After you select all the required settings you can click on close window button. After closing the pop up window, let us click on the build archive button (refer to the image below)

 

When we click on that button, a pop up page opens up where it gives you a summary of the selected settings (refer to the image below)

Please select next after you have reviewed the settings. In the next page, we will be asked to select the .car file. Now, let us create a folder in say “C” drive and name it test. Now, inside the folder let us create a file with extension .car . Let us name it migrate.car. Now, in the page let us browse to the that folder and click on okay and add the file name, the path should look like C:/test/migrate.car (refer to the image below)

Now, let us click on next and we should get a popup message saying “Build Successful” (refer to the image below). 

Click on okay and close the window. Now, let us go to ColdFusion 11 admin page and go to the same place that is  packaging and deployment >> ColdFusion Archives. Let us remember that we have already created the .car file and now we need to deploy it. So we will work on the first option that is deploy an existing archive. Click on the bowser server option and browse to the migrate.car file which we have created earlier. (Refer to the image below)

After entering the path click on deploy button and a pop up window will appear. Click on next and the next page will give you the option to deploy and it will specify the Deploy Locations as well (Refer to the image below)

Once you click on the button deploy, you will get a pop up message saying Deploy successful (Refer to the image below)

 

When you get the above message you have deployed the .car file successfully and with it migration from ColdFusion 9 to ColdFusion 11.

 

Migrate via migration wizard

In case you have a ColdFusion 9 (or 10) Standard installation and are moving to ColdFusion 11 on the same server, then you need to modify the adminconfig.xml within ColdFusion. The location for adminconfig.xml is ColdFusion11cfusionlib

Now, if we are trying to migrate from ColdFusion 9 to ColdFusion 11, please follow the below mentioned steps:-

        ·         Navigate to adminconfig.xml for ColdFusion 11 and open it with text editor.

        ·         Change the value from “false” to “true” at

                          <Runsetupwizard>false</runsetupwizard>

                          <Runmigrationwizard>false</runmigrationwizard> and

                          <migratecf9>false</migratecf9>

        ·         Save the file and restart ColdFusion Service.

After restarting the service, you will get the migration wizard. Follow the on-screen instructions to continue.