我正在运行负载测试,以便查看WCF服务在高峰时间(重负载)期间的性能。我使用的是Step-Load,我们一步一步地推送虚拟用户。当我开始运行前几分钟的负载测试时,测试运行得很顺利,随着负载的增加,一段时间后,突然触发了下面的错误。
“测试方法"XYZ”引发异常:
System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host".我尝试了很多我在网上找到的解决方案,但没有一个对我有效。我尝试更改配置文件中的默认超时、最大连接数、最大并发连接数等。我真的很感激在这方面的任何帮助。
发布于 2013-10-25 20:14:59
当我搬到WCF时,我也遇到了类似的问题。这可能与WCF处理连接的方式有关。
我的解决方案是将每个测试移动到单独的ApplicationDomain中。
https://stackoverflow.com/questions/15080671
复制相似问题