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:
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:
For all the configuration parameters and query parameters refer to the following document: