Tuesday, July 17, 2012

CF: ColdFusion 10 on Tomcat and the CGI mistery

One of the things I applaud Adobe for in the new release of ColdFusion is to have the stomach to change the  underlying Application container. Moving from JRUN to Tomcat is the right step. However, as part of the move, there still seems to be some mystery surrounding what this means.

As pointed out previously by myself, Rupesh Kumar, has published a good primer on the differences, but also introduced some questions which I did not find answers for. So nothing like the present to go and dig.

More specifically he points out that Adobe has made changes (enhancements) to Tomcat that allow it to work hand in hand with their connectors to get more data to the servlet engine; this, according to him, would not be available if you ran a deployment of CF10 on standard Tomcat.

Of course, I wondered, what in particular would not be available and ran some tests. I used the following scenarios (all on Windows 2008 R2):

a) Standard Install of CF 10 with Adobe ISAPI connector and IIS.
b) Standard Install of CF 10 with BonCode connector and IIS.
c) Tomcat WAR deployment of CF with BonCode connector and IIS.
d) Tomcat WAR Deployment using Tomcat web server (Coyote)

I configured the BonCode connector for best alignment with Adobe as outlined in my previous blog post.
I admit that I did not try to use the Apache Tomcat  regular ISAPI redirector, since it would have not worked for scenario a) and b) and I assume that there are differences there. I also did not try Apache HTTPD webserver scenarios.


I arrived at my conclusions by using a sophisticated setup ;o)
I simply dumped the CGI scope and the count of CGI variables, then compare the dump files. The dump files in the download  zip document reflect the output for the scenarios above.


However, overall I was not able to discover large differences in the CGI scope among the different approaches for running ColdFusion 10. The results for scenarios a) - c) were identical, and while scenario d) showed differences, they were minimal. I attribute this to Tomcat's native web-server's interpretation of HTTP protocol. It chooses to interpret traffic and headers slightly differently.

The differences in scenario d) relate to the following  CGI variables:
Content_Length
Context_Path
Gateway_Interface
HTTPS


Thus, if you wish to keep your coding the same, select options a)-c) while exercising some care in the use of Apache Coyote as webserver for ColdFusion 10.

Cheers,
B.