ASP.NET - > WCF并发问题 [英] ASP.NET -> WCF concurrency problem

查看:90
本文介绍了ASP.NET - > WCF并发问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个基于Ajax的应用程序,它使用了大量的服务器的调用与一个数据库通信的WCF层。
每当我从客户端(ASP.NET页)的短时间内内有效多次调用底层WCF服务,系统挂起并进入闲置状态。

I'm developing an Ajax-based application which makes heavy use of server calls to a WCF layer that communicates with a DB. Whenever I effect from the client (an ASP.NET page) many calls within a short span of time to the underlying WCF services, the system hangs and goes into a idle state.

我如何处理这样的并发问题?
谢谢你。

How can I handle such concurrency problems? Thanks.

推荐答案

如果在WCF层通信通过HTTP,你可能打传出连​​接的最大数目HTTP层呢。

If the WCF layer is communicated over HTTP, you possibly hit the maximum number of outgoing connections the HTTP layer does.

<一个href=\"http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.defaultconnectionlimit.aspx\" rel=\"nofollow\">http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.defaultconnectionlimit.aspx

在服务器环境中的默认值是10,这意味着,有可能是从您的应用程序服务器的WCF层最多10个并发传出连接。只要改变这个值越大任何根据并发WCF估计号码的呼叫。

The default value in the server environment is 10 which means that there could be at most 10 concurrent outgoing connections from your application server to the WCF layer. Just change this value to whatever larger depending on the estimated number of concurrent WCF calls.

具体地讲,把这个到的Application_Start 在你面前的Web应用程序(即调用WCF服务,而不是一个与WCF服务的):

Specifically, put this into the Application_Start in your front web application (the one that calls WCF services, NOT the one with WCF services):

   System.Net.ServicePointManager.DefaultConnectionLimit = 200;

这篇关于ASP.NET - &GT; WCF并发问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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