Coldfusion 服务器状态页面

发布于 2024-10-19 13:42:14 字数 191 浏览 1 评论 0原文

我想在 ColdFusion 网站(有专用服务器)上创建一个页面,为用户提供有关服务器承受的压力大小的一些信息。

这样用户就可以去那里看到服务器速度慢的原因是因为流量高,或者是由于其他原因(这可能是我手动提供的信息)。

流量数据需要是动态的。

所以我很好奇以前是否有人尝试过解决类似的问题?是否有一些开源包可以提供帮助?

I'd like to create a page on a ColdFusion website (which has a dedicated 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

旧时模样 2024-10-26 13:42:14

有多种免费(而非免费)CF 监控工具可供使用,形状和大小各异。这是一个很好的列表:
http://cf411.com/#cfmon

该列表中的许多内容都是您正在寻找的类型允许您在单个页面中向用户公开此类数据。如果您确实将其放在公共服务器上,我建议将身份验证放在它前面...这不是您想要向公众公开的信息! :)

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! :)

溇涏 2024-10-26 13:42:14

对于初学者来说,您可以获取有关 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>

也可以(尽管显然并非在所有系统上)获取

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

有关服务器本身内存情况的信息:如果您使用服务器监视器 API。如果您使用 FusionReactorFRAPI 公开了各种有趣的函数,例如 getCpuUsage()

我不确定向用户公开此类信息是否有意义,但有一些选择。

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.

时光瘦了 2024-10-26 13:42:14

我不确定您是否在 Windows 上运行,但如果您是另一个选择是允许 perfmon 收集有关 ColdFusion 实例的统计信息,例如平均请求时间、队列长度等。

您当然也可以通过 perfmon 收集 CPU、可用内存等,并将它们存储在一组日志文件中,您可以使用 CF 计划任务每​​分钟读取一次,并将其存储在数据库中以进行汇总和图表等。

当然,您的数据可能在这种情况下最多可达一分钟,但它对于存储数天和数月的指标非常有用,这样您就可以了解服务器在一段时间内的性能情况。

我们已经使用这个解决方案几年了,虽然需要一些维护,但它确实让我们对所有服务器的性能有一个很好的了解。

我想将来使用 New Relic 之类的东西,但它们不支持 JRun。也许如果 CF 允许与 Tomcat 独立,我们将来会看到这个选项。

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.

递刀给你 2024-10-26 13:42:14

真的取决于您想看到什么具体数据?

我认为谷歌分析的混合,如果你在 Windows 上使用 wmi,收集硬件/操作系统/coldfusion 性能计数器/统计数据。

这是 wmi 和 Coldfusion 的示例。

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

然后这是我同样的问题,以及一些示例:

我想在 Windows 上的 ColdFusion 中使用 WMI 或 Java 来获取性能数据< /a>

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文