Skip to main content

ColdFusion 9.0.1 Server monitoring enhancements

This post gives an Introduction to Server Monitoring Enhancements in CF 9 updater 1. Server Monitoring helps the user to monitor various statistics such as slow requests, load at any point of time, active requests,  requests with errors etc,. In the updater version of ColdFusion,  an embedded server - Jetty is added which listens to a different port: 5500. A page -  Monitoring Settings is added to the administrator where in the user can check the current status of server monitor. This avoids the step of launching and checking whether monitoring, profiling and memory tracking are enabled/disabled.

Configuring and starting Server Monitor:
By default Server Monitor will run on the same port on which coldfusion is running (i.e. without Jetty). However, to improve the performance the embedded server jetty can be enabled. There are three ways of starting Server monitoring with Jetty on a different port:
  • ColdFusion administrator: Sever Monitoring -> Monitoring Settings.
  • Manually by configuring jetty.xml and neo-monitoring.xml
  • Using Admin API.
Configure and start Server Monitor using the Administrator:
Login into the administrator with the administrator credentials and navigate to Server Monitoring -> Monitoring settings. 


The monitoring settings page shows the current status of the Server Monitor; one can enable/disable the same. To enable Jetty check Enable Monitoring Server and specify the port. By default port 5500 will be used. Changes made here will be reflected in the jetty.xml file which can be found in the lib directory. Any attempt made to change the port to a port which is currently not available will result in an error. 

Manually by configuring jetty.xml and neo-monitoring.xml:
Monitoring server can be started manually by setting 'ismonitoringserverenabled' in neo-monitoring.xml to true and restarting the server so that the changes are picked up. As mentioned earlier, the default port at which monitoring server would start is 5500. One can change this in jetty.xml file. One can always change the port number to any other number by referring jetty.xml connector section

Configure and start Server Monitor using Admin API:
Several methods have been added to servermonitoring.cfc, these can be used to configure server monitor. The list of methods added are as mentioned below:

  • setMonitoringServerPort(port_number): This method will change the monitoring server port to the port_number passed in as an argument. As mentioned earlier 5500 port will be used as a default port. However this will not start the monitoring server.
  • getMonitoringServerPort(): This method returns the current monitoring server port number.
  • getMonitoringServerProtocol(): This method will return http or https based on jetty.xml configuration.
  • stopMonitoringServer(): This method will stop monitoring server.
  • startMonitoringServer(): This method will start monitoring server.
  • isMonitoringServerRunning(): This method will check whether a separate monitoring server is running.
  • configureMonitoringServer(flag,port_number): This method can be used to start/stop the monitoring server. 
    • flag (true/false): when set to true will start the monitoring server.
    • port_number: port at which a separate monitoring server should start.
Monitoring Settings page:
With CF 901 a page Monitoring Settings was added under Server Monitoring section. One can not only enable/disable the monitoring server and monitoring port but can also start/stop server monitoring settings: Monitoring, Profiling and Memory tracking. This will also avoid the step of launching the server monitor to check the status of the same. 

Comments

  1. Thanks Sagar. I began a comment, but since it was quite large I posted a blog entry for it here: http://bit.ly/chBSRq

    ReplyDelete
  2. Great to see you blogging on the Server Monitor, Sagar. It's an area of great interest for me, and one that I've enjoyed sharing info about. I hope you (and others at Adobe) will be sharing more.

    As for 9.0.1, we should point out that there are still more interesting changes related to the monitor, such as the ability to start/stop the 3 buttons ("monitoring", "profiling", and "memory tracking") from within the CF Admin.

    That's a great boon both for when we can't access the Server Monitor for some reason, but also simply so that people can see from within the CF Admin when these option are enabled. Some don't realize that even if the "monitor interface" is closed, the overhead of these buttons being enabled still accrues to the CF server.

    ReplyDelete
  3. Thanks Steve, Charlie for sharing your views.

    @Charlie: I have updated the post.

    ReplyDelete
  4. I have also blogged about Multi Server monitor changes: http://goo.gl/b/MwvO

    ReplyDelete
  5. Hi dude,
    i read your blog, This is not necessary
    regarding your blog.This is a wonderful blog.I was able to get the
    information that I had been looking for. Thanks once again.
    Thank You
    ColdFusion Developer

    ReplyDelete
  6. Hi,

    Can you tell me how to set up aliases in CF 9 Server Monitor settings.We get a caseInsensitiveMap cannot be cast to coldfusion.runtime.struct? Any ideas?

    Thanks?

    ReplyDelete
  7. Refer to this post by Ray: http://www.coldfusionjedi.com/index.cfm/2008/5/15/Two-ColdFusion-Server-Monitoring-Tips

    ReplyDelete

Post a Comment

Popular posts from this blog

File upload and Progress events with HTML5 XmlHttpRequest Level 2

The XmlHttpRequest Level 2 specification adds several enhancements to the XmlHttpRequest object. Last week I had blogged about cross-origin-requests and how it is different from Flash\Silverlight's approach .  With Level 2 specification one can upload the file to the server by passing the file object to the send method. In this post I'll try to explore uploading file using XmlHttpRequest 2 in conjunction with the progress events. I'll also provide a description on the new HTML5 tag -  progress which can be updated while the file is being uploaded to the server. And of course, some ColdFusion code that will show how the file is accepted and stored on the server directory.

Server sent events with HTML5 and ColdFusion

There are several ways to interact with the server apart from the traditional request\response and refresh all protocol. They are polling, long polling, Ajax and Websockets ( pusherapp ). Of all these Ajax and Websockets have been very popular. There is another way to interact with the server such that the server can send notifications to the client using Server Sent Events (SSE) . SSE is a part of HTML5 spec:  http://dev.w3.org/html5/eventsource/

Adding beforeRender and afterRender functions to a Backbone View

I was working on a Backbone application that updated the DOM when a response was received from the server. In a Backbone View, the initialize method would perform some operations and then call the render method to update the view. This worked fine, however there was scenario where in I wanted to perform some tasks before and after rendering the view. This can be considered as firing an event before and after the function had completed its execution. I found a very simple way to do this with Underscore's wrap method.