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:

 

  • mime: Specifies the output format. If someone is running a script to get status information and parse it, the value should be xml. If its only used for display purpose, then it should be html.
  • cmd: Specifies what action you want to perform. list displays details of all the configured workers. show displays information of a specific worker.
  • w: Specifies name of the worker. It should be used along with cmd=show.
  • sw: Specifies name of subworker if w referred to a lbworker.
  • opt: Specifies which information should not be displayed. It is bitmask of desirable options. The allowed values 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:

 

2 Comments to “Configuring Status Worker in Connectors”

  1. brian
    Interesting post, good candidate for a short video preso I would say.
  2. Charlie
    Very interesting stuff, Chinoy. Thanks very much for sharing.

    I do have a few observations that readers should consider. I started to write them here, but they became too lengthy for a comment, so I would point readers here to a blog post I just made:

    http://www.carehart.org/blog/client/index.cfm/2015/8/3/more_on_tomcat_status_worker

    A couple of the points are quite important, so I hope anyone interested in this status worker feature will come visit, and share comments, either there or here. (Not sure which will be best. I suppose leaving them on my blog would be best, if replying to what I write there. But I'll let you each be the judge of that.)

Leave a Comment

Leave this field empty: