Entries Tagged as “Connector”

Configuring Status Worker in Connectors

July 19, 2015 / Chinoy Gupta

  Adobe ColdFusion 10 | Adobe ColdFusion 11 | Connector

Sometimes there is a requirement to know the realtime load on a ColdFusion Server. One way to get this information is through cfstat which displays the relevant information at CF server/Tomcat level. One more way to get this information is through Status worker which displays the information at Webserver/Connector level. 

A status worker is a special type of worker which does not communicate with Tomcat. Instead it gathers configuration and load details from other workers and displays it. It can also be used to change some details dynamically. Configuring a status worker is pretty straightforward. After the connectors are successfully configured with wsconfig tool, we need to change worker.properties and uriworkermap.properties to enable status worker. In worker.properties, add a new worker:

worker.list=cfusion,cfstatus

worker.cfstatus.type=status


In uriworkermap.properties, add a uri mapping to this worker:

/cf/status = cfstatus

Restart the webserver.

Now whenever a request comes at http://WebserverIP:Port/cf/status, it will be redirected to this status worker which will display the relevant information based on the query parameters in the request. Some of the common parameters are:

 

0x0001: hide members of lb workers

0x0002: hide URL maps

0x0004: hide the legend (Works only with html)

0x0008: hide load balancer workers

0x0010: hide ajp workers

0x0020: only allow read_only actions for a read/write status worker.

0x0040: hide load balancer configuration  (Works only with html)

0x0080: hide load balancer status summary (Works only with html)

0x0100: hide configuration for ajp and load balancer member workers (Works only with html)

 

So to get details of cfusion worker, an example url will be:
http://IP:Port/cf/status?mime=html&cmd=show&w=cfusion&opt=262 (0x0002 | 0x0004 | 0x0100)

Status worker can also be used to modify some config parameters dynamically. If someone doesnot want that functionality, it can be configured in read-only mode also. Just add the following line in worker.properties:
worker.cfstatus.read_only=True

For all the configuration parameters and query parameters refer to the following document:
https://tomcat.apache.org/connectors-doc/reference/status.html

 


Setting up ColdFusion in distributed envionment

July 02, 2015 / Krishna Reddy

  Administrator | ColdFusion | ColdFusion 11 | Connector | creating a website | customers | Docs | General | productivity | Tomcat | web application | web application development

You might want to set up ColdFusion in a distributed environment where ColdFusion is running on one machine and Web server is running on a different machine.

Following are the set of steps that have to be performed to achieve this (less error-prone):

This applies to both ColdFusion 10 and ColdFusion 11.

1) Have ColdFusion server installed in a machine.

2) Next thing is to download and install VC Runtime.

             - The version of VC Runtime that you have to install depends on the version of ColdFusion.

                Say, ColdFusion 11 needs VC Runtime 2012

                 (32-bit VC Runtime for 32-bit Web server and 64-bit VC Runtime for 64-bit Web server.

                  If you are not sure, you can install both)

                 (https://www.microsoft.com/en-in/download/details.aspx?id=30679)

                and ColdFusion 10 needs VC Runtime 2010

 

3) Copy the following contents from the machine where ColdFusion is running to the machine where Web server is running at the same location.

 C:\ColdFusion11\jre

 C:\ColdFusion11\runtime\lib\wsconfig.jar

 C:\ColdFusion11\runtime\conf\server.xml

 

4) Open a Command prompt and run wsconfig tool

   C:\ColdFusion11>jre\bin\java -jar cfusion\runtime\lib\wsconfig.jar

    It will open a configuration window where you have to provide AppServer Host as the ColdFusion Server IP.

    Configure the connector.

Distributed environment is ready for use. Send requests to the Web server's URL with cfm files under web server root and same files under ColdFusion's Web root.

Web server would redirect these to ColdFusion, which is on some other machine.

 

 


Custom Error + onMissingTemplate + CF + IIS = confusion?? Not Exactly

February 16, 2015 / Milan Chandna

  Adobe ColdFusion | Adobe ColdFusion 10 | Adobe ColdFusion 11 | Connector

I have seen many customers getting confused in custom error pages and onMissingTemplate feature in ColdFusion and IIS. So I thought of blogging it for the use of larger audience. Before starting let me setup a platform.

Customer Eddard(name assumed) is using ColdFusion10(valid for ColdFusion11 too) configured with IIS. He has setup onMissingTemplate in Administrator of ColdFusion. Now Eddard expects ColdFusion to run this error page(mentioned in onMissinTemplate), let's call it 404.cfm, whenever user hits a page which doesn't exist. But suprisingly his browser is not showing the contents of 404.cfm and instead showing IIS 404 error page which is a static file(html file). After a lot of struggle he finds another confusing behavior that when he access the non existing page from machine where server is running(localhost) then his 404.cfm is getting executed. It's clear from the behavior that there is somehting in IIS which is handling this behavior.

.

.

.

You guys must be thinking what is the right approach then. I will give three scenarios and you can chose any one depending upon your requirements.
1. Custom error page - Simply use custom error page and do not use onMissingTemplate. You have to opt for "Custom error pages" in "IIS->site->error pages->edit feature settings". And give a 404.cfm url against required status code like 404 in "IIS->site->error pages". This cfm will be executed whenever that error has been hit like a user requested for non existing page. The page will not be executed twice since you have not mentioned anything in onMissingtemplate.

.

.

.

Read More


Resolving "500 Internal Server Error" with ColdFusion 10 Update 14

October 16, 2014 / Krishna Reddy

  Administrator | Adobe ColdFusion 10 | ColdFusion | Connector | General | Hotfix

We have seen that some of you have not been able to get the web server connector working after applying update 14.

We did our investigation and following is our finding.

The connector binaries of ColdFusion 10 update 14 are built on top of  VC++ runtime 2012 update 4.

Installation of VC++ runtime requires admin privileges. If the ColdFusion service runs as administrator or system account, the update itself install the VC++ runtime as this account would have installation privileges.

If your ColdFusion service account is not running as administrator or system account, applying the hotfix from administrator can't install VC++ runtime and you will get "500 internal server error" after configuring the connector.

In this case, you need to manually install VC++ runtime 2012 32-bit and/or 64 bit depending on whether Web server is 32-bit or 64-bit.

You can download VC++ runtime here at:

http://www.microsoft.com/en-in/download/details.aspx?id=30679

When you install hotfix manually, administrator privileges are enforced and so the installation of VC++ runtime is automatically taken care by the updater.

 

 

 

 


ColdFusion 11 IIS Connector Tuning

May 22, 2014 / Anit Kumar Panda

  Performance | Administrator | Adobe ColdFusion 11 | Connector | General | Splendor | Tuning

Connector tuning is an essential part of setting up a ColdFusion server. There are various configurations in connector that needs to be tuned. Incorrect values may lead to “Service Unavailable” or “Server too busy”. In this blog, we will discuss how to handle such errors caused by incorrect tuning and how to tune the connectors for the site correctly.

The connector setting may vary from site to site. It is very important to configure the connectors for your application appropriately. This blog will include connector tuning parameters for IIS. During installation, user can choose to configure connector for “Individual Site” or “ALL” sites in IIS connector configuration.

Configure Web Server

After the installation, the user can launch the “Web Server Configuration tool” and has the availability to create the connector for “Individual Site” or “ALL” sites in IIS.

Add Web Server configuration

When connector is configured with individual sites, separate connector for each site will be placed under {CF-Home}/config/wsconfig/{some no}/. Similarly for “ALL” configuration the connector is configured at global level, which means the same connector binary will be used across multiple sites.

The three most important parameters will be discussed here and will help us to understand the role of the same:-

Re-use connections: - This setting determines the count of connections that can be re-used. When Tomcat connector makes a connection with Tomcat server, it does not closes the connection even after it finished serving the request. Instead it keeps the connection active, so that for the next request, the same connection can be re-used. This increases the performance by minimizing the overhead of creating new connection with tomcat server for every request. This settings needs to be tuned for connector configured with multiple sites. The max value for the re-use connection is determined based on the number of sites configured with same CF server and the load on each site.

The default re-use connection is 250.

Connection pool size: - This setting determines the maximum number of connections that can be created in the connection pool. When multiple requests arrive to the connector from IIS, connector creates new connections in the connection pool only if there are no free connections available in the pool. The connector will not create a new connection if connections reach the connection pool size limit. When connector is configured with “ALL” sites, the same connection pool will be used to serve the request for all sites. So the default value of the connection pool size, works well with the single site configuration, but fails to work well with “ALL” site configuration in some scenarios. Hence this value should be increased carefully based on the need and number of sites that are present within IIS.

The default connection pool size is same as, which is 250.

Connection pool timeout: - This setting determines the timeout value (in seconds) for idle connections in connection pool. This value must be in sync with the connectionTimeout attribute of your AJP connector in Tomcat's server.xml.

The default timeout for connection is indefinite, if not set in server.xml explicitly.

There are other parameters which CF connector inherits from Tomcat AJP connector. Please find the details of those settings from AJP documentation (http://tomcat.apache.org/connectors-doc/reference/workers.html)

The worker.properties is available at {CF-Home}/config/wsconfig/{some no}/ and the server.xml can be found at {CF-Home}/cfusion/runtime/conf/. Below are the changes required to tune the Site:-

There can be multiple use cases. Let us consider three most widely used scenarios:-

Use Case# 1: Connector created with “ALL” OR with “Individual” Site and single site in IIS

In an idle scenario, where the user has only one site (configured with ALL or individual connector) and not running under high load, the worker.properties, can look like this

worker.list=cfusion

worker.cfusion.type=ajp13

worker.cfusion.host=localhost

worker.cfusion.port=8012

worker.cfusion.max_reuse_connections=250

worker.cfusion.connection_pool_size=500

worker.cfusion.connection_pool_timeout=60

And server.xml should look like

<Connector port="8012" protocol="AJP/1.3" redirectPort="8445" tomcatAuthentication="false" maxThreads="500" connectionTimeout ="60000"> </Connector>

So, we added the connection_pool_size and connection_pool_timeout (in seconds) in the worker.properties. The corresponding connectionTimeout (in milliseconds) is added to server.xml along with maxThreads whose value is equivalent to the connection_pool_size in the worker.properties.

Use Case# 2: Connector created with “ALL” and multiple sites in IIS

Consider a scenario that the connector is created with “ALL” and there is only one site which is running under load. The default 250 re-use connections are utilized by site 1. Later on, the user adds another site in IIS.

Site 1 will make all 250 re-usable connections with ColdFusion and any request for new connection from site 2 will be ignored by ColdFusion. Hence it is required, to increase the re-use connection count to optimal value, so that site 2 does not starve for new connections. This can be achieved by configuring optimal value of max_reuse_connections count. Considering that the site 2 is not running under high load, 100 re-use connection will work. So the max_reuse_connections becomes 350 {250 (for site 1) + 100 (for site 2)}. But, it is a good practice, to start tuning the connection_pool_size first, and then the max_reuse_connections appropriately.

This case would require connection_pool_size=700, as max_reuse_connections= connection_pool_size / {no of site}. So, the worker.properties will look like this

worker.list=cfusion

worker.cfusion.type=ajp13

worker.cfusion.host=localhost

worker.cfusion.port=8012

worker.cfusion.max_reuse_connections=350

worker.cfusion.connection_pool_size=600

worker.cfusion.connection_pool_timeout=60

And server.xml should look like

<Connector port="8012" protocol="AJP/1.3" redirectPort="8445" tomcatAuthentication="false" maxThreads="700" connectionTimeout ="60000"> </Connector>

Note: The connectionTimeout is in milliseconds

Use Case# 3: Connector created with “Individual” site and multiple sites site in IIS

Consider a scenario that the individual connectors are created for each site. There are three sites - Site 1 is running under high load, site 2 and site 3 running are under low load. For all the sites, there are individual connectors. Now, ideally in this scenario, we should start tuning with the site running under high load first. We can disable the timeout for high traffic sites, if we are not sure for timeout. If not defined, the default timeout for connection is indefinite. To start with, don’t specify the re-use parameter. Set the connection_pool_size=500 and monitor the site. Gradually increase the value by 100 and likewise, till the site is stable. Say, at connection_pool_size=800, the site is stable. Now, set the max_reuse_connections=270 (connection_pool_size / {no of site} i.e. 800/3=270 approx)

Site 1

worker.list=cfusion

worker.cfusion.type=ajp13

worker.cfusion.host=localhost

worker.cfusion.port=8012

worker.cfusion.max_reuse_connections=270

worker.cfusion.connection_pool_size=800

worker.cfusion.connection_pool_timeout=60

Site 2 and site 3 are running under low traffic, but are bind to same ColdFusion instance (cfusion in this case). The below settings should be optimal:-

Site 2

worker.list=cfusion

worker.cfusion.type=ajp13

worker.cfusion.host=localhost

worker.cfusion.port=8012

worker.cfusion.max_reuse_connections=100

worker.cfusion.connection_pool_size=250

worker.cfusion.connection_pool_timeout=60

Site 3

worker.list=cfusion

worker.cfusion.type=ajp13

worker.cfusion.host=localhost

worker.cfusion.port=8012

worker.cfusion.max_reuse_connections=100

worker.cfusion.connection_pool_size=250

worker.cfusion.connection_pool_timeout=60

And server.xml should look like

<Connector port="8012" protocol="AJP/1.3" redirectPort="8445" tomcatAuthentication="false" maxThreads="1300" connectionTimeout ="60000"> </Connector>

Note: The connectionTimeout is in milliseconds and the maxThreads is the value equivalent to summation of all the connection_pool_size(s). So, in this case maxThreads=1300 {800 (for site 1) + 250 (for site 2) + 250 (for site 3)}.

Some key points to remember:-


Blue Mango Theme Design By Mark Aplet

Super Powered by Mango Blog