相关疑难解决方法(0)

WCF超时异常详细调查

我们有一个应用程序,它具有在IIS7上运行的WCF服务(*.svc)以及查询该服务的各种客户端.服务器正在运行Win 2008 Server.客户端正在运行Windows 2008 Server或Windows 2003服务器.我得到以下异常,我看到它实际上可能与大量潜在的WCF问题有关.

System.TimeoutException: The request channel timed out while waiting for a reply after 00:00:59.9320000. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The HTTP request to 'http://www.domain.com/WebServices/myservice.svc/gzip' has exceeded the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer …
Run Code Online (Sandbox Code Playgroud)

wcf timeout timeoutexception

94
推荐指数
1
解决办法
11万
查看次数

WCF服务限制

我在控制台应用程序中部署了WCF服务,并启用了BasicHTTPBinding和SSL.还设置了以下属性:

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
Run Code Online (Sandbox Code Playgroud)

我还设置了限制行为

<serviceThrottling maxConcurrentCalls="2147483647" maxConcurrentSessions="2147483647"
        maxConcurrentInstances="2147483647" />
Run Code Online (Sandbox Code Playgroud)

另一方面,我创建了一个测试客户端(用于负载测试),它同时启动多个客户端(多个线程)并在服务器上执行事务.一切似乎都很好,但在服务器上CPU利用率没有增加所以我添加了一些日志记录来查看服务器的并发调用数,发现它从未超过6.

我已经查看了两次以上的性能计数器记录代码,对我来说似乎很好.

所以我想问一下这种情况下的问题在哪里?我还没有指定任何种类的ContextMode或ConcurrencyMode.

这个帖子之后,我注意到,每当我开始测试客户端的另一个Intance我的并发服务器调用计数器增加至2一样,如果我运行仅1个实例的最大并发RCVD呼叫将被2,如果有两个实例相同的值变为4等等.一次处理的WCF呼叫数量是否有限制?

********3月17日添加********

今天我在运行服务器的同一台机器上运行了一个测试客户端(有50个并发用户)的另一个测试.这次我得到了我想要显示的确切结果(即服务器的最大并发呼叫数Rcvd = 50).

但我需要在其他机器上也这样做.有人可以帮我这个吗?

.net wcf throttling

18
推荐指数
2
解决办法
2万
查看次数

Wcf突然挂起(网络获取操作)

我阅读了很多关于客户端应该关闭连接的文章,client.Close()因此WCF默认限制不会被超过.事实上,我有WCF WebGet操作,基本上只返回一个图像.

[ServiceContract(SessionMode = SessionMode.NotAllowed)]
[ValidationBehavior]
public interface IImagesService
{
    [OperationContract(Name = "ImagesGet4")]
    [WebGet(UriTemplate = "/Image/{partner}/{id}/{image}_{width}_{height}.jpg")]
    Stream ImagesGet2(string partner, string id, string image, string width, string height);
  }
Run Code Online (Sandbox Code Playgroud)

在这种情况下,客户端是浏览器,无论我使用wcf配置做什么都无济于事.maxConnections,maxReceivedMessageSize,maxBytesPerRead 很多其他参数都被淘汰出局,但仍然没有运气.

编辑: 这是附加代码: ImageGet服务调用的方法:

       public Stream ImagesGet(string partner, string id, string image, string      width = null, string height = null)
        {
           WSData.EventLogs.MinimalEventSource.Log.ClientIp("");
           WSData.EventLogs.MinimalEventSource.Log.ServicePath("");
           WSData.EventLogs.MinimalEventSource.Log.Message( DateTime.Now + " | " + partner );


        bool cache;
        var images = new Images();
        var stream = images.ImagesGetStream(out cache, partner, id, image, …
Run Code Online (Sandbox Code Playgroud)

c# wcf

6
推荐指数
1
解决办法
342
查看次数

标签 统计

wcf ×3

.net ×1

c# ×1

throttling ×1

timeout ×1

timeoutexception ×1