简体   繁体   English

使用JMeter对本地IIS中托管的WCF服务进行负载测试

[英]Load testing WCF service hosted in local IIS using JMeter

My requirement is to load test a WCF service hosted in the local IIS server. 我的要求是对本地IIS服务器中托管的WCF服务进行负载测试。 We are trying to improve the performance of a WCF service. 我们正在尝试改善WCF服务的性能。 In the PROD environment both the WCF service and the desktop application which consumes this service also resides in the same machine. 在PROD环境中,WCF服务和使用此服务的桌面应用程序也都位于同一台计算机上。

So in order to baseline the existing performance of the WCF serrvice, I'm trying to use JMeter to load-test the service by running it from the same machine where the service is hosted. 因此,为了确定WCF服务的现有性能基线,我试图通过在托管服务的同一台计算机上运行JMeter来对服务进行负载测试。

I'm using JMeter's HTTP Test Script Recorder to capture any request going from desktop app to WCF service, so that I will be able to later increase the thread count to get the performance measurements. 我正在使用JMeter的HTTP测试脚本记录器来捕获从桌面应用程序到WCF服务的所有请求,以便以后可以增加线程数以进行性能评估。

problem is I'm unable to capture any requests going to the service hosted in the local IIS server. 问题是我无法捕获对本地IIS服务器中托管的服务的任何请求。 But if I host the same service in a separate server and execute the Jmeter from the machine where consuming desktop app is running, then Jmeter is able to capture all the outgoing requests to that web server. 但是,如果我将相同的服务托管在单独的服务器中,并从运行使用桌面应用程序的计算机上执行Jmeter,则Jmeter能够捕获到该Web服务器的所有传出请求。

Is that even possible to record requests where service and consuming desktop app both resides in the same machine? 甚至可以记录服务和使用桌面应用程序都驻留在同一台计算机上的请求吗?

Current Configurations 当前配置

I'm using 8895 as the port number in the Jmeter proxy 我正在使用8895作为Jmeter代理中的端口号

在此处输入图片说明

Manual proxy setting in windows (using the same port number configured in Jmeter) 在Windows中手动设置代理(使用在Jmeter中配置的相同端口号)

在此处输入图片说明

Desktop app configuration file (which sends requests to local service) 桌面应用程序配置文件(将请求发送到本地服务)

    <bindings>
        <wsHttpBinding>
            <binding name="WSHttpBinding_IPayment" proxyAddress="http://127.0.0.1:8895" useDefaultWebProxy="false" bypassProxyOnLocal="false">                     
                <security mode="None" />
            </binding>            
        </wsHttpBinding>        
    </bindings>
    <client>
      <!--<endpoint address="http://10.2.179.100/PaymentService/Payment.svc " binding="wsHttpBinding"-->                      
      <endpoint address="http://127.0.0.1:88/Payment.svc" binding="wsHttpBinding"          
          bindingConfiguration="WSHttpBinding_IPayment" contract="PaymentServiceReference.IPayment"
            name="WSHttpBinding_IPayment" />
    </client>
</system.serviceModel>

  1. You might need to add Microsoft Loopback Adapter in order to capture link-local traffic 您可能需要添加Microsoft回送适配器以捕获本地链接流量

    在此处输入图片说明

  2. You might need to set a system-level HTTP proxy like: 您可能需要设置系统级HTTP代理,例如:

     netsh winhttp set proxy 127.0.0.1:8895 

More information: How to Run Performance Tests of Desktop Applications Using JMeter 详细信息: 如何使用JMeter运行桌面应用程序的性能测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM