如何在IIS中使用性能计数器和WCF服务? [英] How to work with Performance counters and WCF service in IIS?

查看:535
本文介绍了如何在IIS中使用性能计数器和WCF服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IIS7中有一个WCF服务,通过TCP(WAS)与winform应用程序通信,现在我需要监控性能。

I have a WCF service in IIS7 that communicates with a winform application over TCP(WAS), now I need to monitor the performance.

我已将此添加到web.config文件中:

I have added this to the web.config file:

  <system.serviceModel>
    <diagnostics performanceCounters="All" />

打开性能监视器后,我用winform运行几个测试,以确保服务是激活。

After opening the Performance Monitor I run a couple of tests with my winform to make sure that the service is activated.

然后我打开性能监视器(实时),右键单击并添加计数器。我展开了ServiceModelService 4.0.0.0并选择了Calls和Calls Duration,我还选择了我在所选对象实例列表框中声明的服务(svc),然后单击Add按钮。

I then open the Performance Monitor (live), right click and add counters. I expand the ServiceModelService 4.0.0.0 and select Calls and Calls Duration, I also select my service(svc) that is stated in the Instance of selected object listbox and click Add button.

在ServiceModelOperation 4.0.0.0下选择呼叫和呼叫持续时间时,是否没有要选择的实例或操作? ServiceModelEndpoint 4.0.0.0也是如此?

When selecting Calls and Calls Duration under ServiceModelOperation 4.0.0.0 there is however no Instance or operation to select? The same goes for ServiceModelEndpoint 4.0.0.0?

单击确定时,将添加两个计数器(ServiceModelService)。

When clicking Ok two counters will be added(ServiceModelService).

然后我点击取消冻结显示并启动我的winform应用程序进行几次调用,但是我在性能监视器中看不到任何内容。我试图右键单击其中一个性能计数器并选择Scale Selected Counter但这没有任何作用?

I then click unfreeze display and start my winform application that makes a couple of calls, however I do not see anything in the Performance Monitor. I have tried to right-click on one of the performance counters and select "Scale Selected Counter" but this does nothing?

目标只是看看WCF的效果如何服务执行(速度,持续时间,金额,连接等),检查个别操作也很棒。

The goal is simply to see how well the WCF service performs (speed, duration, amount, connections and so on) and it would also be great to check individual operations.

请帮忙!

注意:这是我试图遵循的文章: http://dkochnev.blogspot.com/2011/06/wcf-framework-40-monitoring-service.html

Note : this is the article I have tried to follow : http://dkochnev.blogspot.com/2011/06/wcf-framework-40-monitoring-service.html

推荐答案

WCF服务包括可以使用 Windows性能监视器(Perfmon.exe)。您可以从Windows Server 2003中的管理工具启动它。

WCF services includes performance counters that you can track with the Windows Performance Monitor (Perfmon.exe). You can launch this from the Administrative Tools in Windows Server 2003.

可以从服务的.config文件的诊断部分启用性能计数器,如以下示例配置:

Performance counters can be enabled from the diagnostics section of the .config file for the service, as shown in the following sample configuration:

<configuration>
  <system.serviceModel>
    <diagnostics performanceCounters="All" /> 
  </system.serviceModel>
</configuration>

您可能需要查看这些文章,它们可以指导您如何使用WCF的性能计数器服务:

You may want to check out these articles which can guide you on how to use the performance counters for WCF services:

  • MSDN - WCF Performance Counters
  • MSDN - Using Performance Counters
  • How to use performance counters to diagnose performance of WCF applications

这篇关于如何在IIS中使用性能计数器和WCF服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆