如何对负载测试失败的WCF服务进行故障排除?

如何对负载测试失败的WCF服务进行故障排除?,wcf,web-services,.net-4.0,Wcf,Web Services,.net 4.0,我在IIS 7(Windows Server 2008)上运行WCF 4服务,并将其部署到开发服务器。当我运行一个使用该服务的小型网站时,该服务就会工作(单击一个按钮,页面调用该服务,返回数据。这是非常基本的) 我还创建了一些调用服务的单元测试,并将它们放入负载测试中。简言之,“单元测试”调用服务并将从服务返回的字节[]写入文件。运行负载测试时,服务将按预期执行 问题是,负载测试在非常少的迭代次数后失败。有时我们的电话是成功的,有时是五次电话之后。同样,单独测试运行良好,但是当我将它们放在一起模

我在IIS 7(Windows Server 2008)上运行WCF 4服务,并将其部署到开发服务器。当我运行一个使用该服务的小型网站时,该服务就会工作(单击一个按钮,页面调用该服务,返回数据。这是非常基本的)

我还创建了一些调用服务的单元测试,并将它们放入负载测试中。简言之,“单元测试”调用服务并将从服务返回的
字节[]
写入文件。运行负载测试时,服务将按预期执行

问题是,负载测试在非常少的迭代次数后失败。有时我们的电话是成功的,有时是五次电话之后。同样,单独测试运行良好,但是当我将它们放在一起模拟一个实时环境(多个用户、多个测试迭代)时,这个问题就会出现

引发的异常是:

Test method TestProject1.UnitTest1.RunReport threw exception: 
System.ServiceModel.CommunicationException: 
An error occurred while receiving the HTTP response to http://xx.xx.xx.xx:yy/Service.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host 
更新#1:
我只是将测试迭代设置为10(运行测试10x),将恒定用户负载设置为1。测试能够成功地完成。这是使用最基本的单元测试。第二个更复杂的测试在此运行中被省略。

查看应用程序事件日志(eventvwr.exe)。假设您在一个基本正常的环境中运行,那么会有一个服务器端错误条目