开发者

coldfusion server status page

I'd like to create a page on a ColdFusion website (which has a ded开发者_如何学Pythonicated server) which provides users with some information about the amount of stress that the server is under.

So that users can go there and see that the reason that the server is slow is because of the high traffic, or due to something else (which would prob be information that I provide manually).

The traffic data needs to be dynamic.

So I'm curious if anyone else has tried tackling something like this before? and if there might be some open source package available to help out?


There are several free (and not free) CF monitoring tools available out there of all shapes and sizes. Here's a good list: http://cf411.com/#cfmon

Many on that list are the type you're looking for that would allow you to expose such data to your users in a single page. If you do put this on a public server, I'd recommend putting authentication in front of it...this is not the kind of info you'd want to expose to the general public! :)


For starters, you can obtain live information about memory usage within the JVM:

<cfset runtime = CreateObject("java","java.lang.Runtime").getRuntime()>
<cfset freeMemory = runtime.freeMemory() / 1024 / 1024>
<cfset totalMemory = runtime.totalMemory() / 1024 / 1024>
<cfset maxMemory = runtime.maxMemory() / 1024 / 1024>

It's also possible -- although apparently not on all systems -- to get information about the memory situation on the server itself:

<cfset mFact = createObject('java','java.lang.management.ManagementFactory')>
<cfset osBean = mFact.getOperatingSystemMXBean()>
<cfset freeSystemMem = osBean.getFreePhysicalMemorySize()>
<cfset totalSystemMem = osBean.getTotalPhysicalMemorySize()>

You can go into greater detail if you use the Server Monitor API. And if you use FusionReactor, the FRAPI exposes all kinds of interesting functions, like getCpuUsage().

I'm not sure it makes sense to expose this kind of information to your users, but there are options.


I'm not sure if you are running on Windows, but if you are another option is to allow perfmon gather stats about your ColdFusion instance such as Average Request Time, Queue Length etc.

You can also of course gather CPU, Available Memory etc via perfmon and store them a set of log files you can read once a minute using a CF scheduled task and store in the database to summarise and graph etc.

Of course your data might be up to a minute old in this case, but it can be very useful for storing metrics over days and months so you can see how your server is performing over time.

We have used this solution for a few years now and while it takes some maintenance, it does give us a great overview of how all our servers perform.

I would like to use something in future like New Relic but they do not support JRun. Maybe if CF allow standalone with Tomcat we'll see this option in future.


Really depends on what exact data you want to see?

I think a mixture of google analytics, and if your on windows using the wmi, to gather hardware/os/coldfusion performance counters/statistics.

Here is an example of wmi and coldfusion.

http://misterdai.wordpress.com/2010/03/02/askdave-cf7-cpu-usage-on-windows/

And then here was my same exact question, and some examples:

I want to use WMI or Java in ColdFusion on Windows to get performance data

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜