2

It seems this is a common question/problem but despite checking out a number of proposed solutions nothing worked for us so far.

The app

It's a simple chat app, that puts a new interface on an existing app's JSON library. We proxy all the calls to their app to avoid x-domain restrictions (IE8). ASP.net MVC3 App;

It's hosted in IIS6, W2K3 SP2. DEV svr has 1gig ram, TEST svr has 4gig ram.

The problem

When we approach 20 concurrent users, requests start lagging - no issues in Event Viewer to be found. It looks like calls are just queued. There are NO 503's returned.

What we've tried

  • We're using AsyncController to long-poll a 3rd party webservice for results Hosted in IIS6
  • We're using the TPL to call their service in our AsyncController method
  • We've modified processModel and set maxWorkerThreads=100.
  • We've looked at this how-to but the HTTP.SYS config looks to service an infinite number of threads so we haven't bothered adding the reg keys.
  • The 3rd party service can handle lots of concurrent requests (and is in a web farm, so we're fairly confident we're the weakest link)

what are we missing? - any help greatly appreciated

4

1 回答 1

2

嗯......差不多四个星期后,我想我会更新这个,以防有人想知道是什么帮助我们克服了这些限制(我们在我们的 DEV 服务器 1gig Xeon 上塞满了大约 100 个模拟连接)。

异步控制器

  • 如果您有一个潜在的长时间等待请求(即长时间轮询),请使用它们。
  • 随意使用TaskFactory但请务必将其标记为长时间运行的进程,如果您的线程中存在异常风险,请务必使用 ContinueWith 以便您可以减少操作,并将错误返回给调用者。

服务点管理器

  • 如果您正在进行下游调用(即 WebService/3rd 方 API),请确保您已从默认的 2 个同时连接增加 DefaultConnectionLimit。
  • 粗略的指南是 8 * Num 核心,这样您就不会饿死传出连接资源。
  • 有关更多信息,请参阅有关 DefaultConnectionLimit 的 MSDN 文章。

IOCP 与 RestSharp

最后,我们的问题不在于传入的请求,而在于请求被代理给第三方,我们没有提供足够的连接,因此它们都排队等待整个系统。很高兴地说,经过大量阅读、调查和编码,我们已经解决了这个问题。

于 2012-05-15T13:07:44.647 回答