ASP.NET网站在负载下变得无法响应 [英] ASP.NET website becomes unresponsive under load

查看:125
本文介绍了ASP.NET网站在负载下变得无法响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个由两个组件组成的产品。在IIS 8下托管的WEB API站点,我称之为API。该站点为多个站点提供服务,但目前只有一个站点正在使用它。该站点的另一个组件是ASP.NET MVC(.NET 4)站点,该站点目前是API站点的唯一客户端。我们称之为WEB。

We have a product made of two components. A WEB API site hosted under IIS 8 which I call it API. This site provides services to multiple sites however at the moment only one web site is using it. The other component of this site is a ASP.NET MVC (.NET 4) site that is at the moment the only client of the API site. Let's call it WEB.

当我们将API和WEB部署到具有生产能力的单个服务器时,一切都很好,直到并发用户数超过16个!然后该网站变得没有响应,这意味着我们没有得到超时(或任何其他)错误,浏览器正在等待响应。

When we deployed the API and WEB to a single server with production capacity everything was fine until when the number of concurrent users exceeded 16! Then the site became unresponsive which means that we did not get a Timeout (or any other) errors and the browser was waiting for a response for good.

我们使用在线负载测试网站在我们的临时环境中重现了同样的问题。当并发用户数超过12或16(或更高)时,网站再次没有响应。

We reproduced the same issue in our staging environment using an online load test web site. Again the site becomes unresponsive when the number of concurrent users exceeds 12 or 16 (or higher).

当发生这种情况时,网站会在10分钟内死亡然后变为响应。我想这是因为App Poll被回收了吗?

When this happens the site kind of dies for like 10 minutes and then becomes responsive. I guess this is because the App Poll gets recycled?

问题是我如何知道问题是存在于API还是存在于WEB中?那可能是什么问题呢? WEB完全依赖于API并且不直接连接到任何数据库,但API在AWS上使用MySql。

The question is that how can I know if the problem resides in the API or in WEB? Then what could be the possible issue? WEB totally relies on API and does not connect to any databases directly but API is using MySql on AWS.

推荐答案

正如一些用户指出的那样在这里,问题是线程耗尽(又名线程争用)。我们试图识别并修改任何可能阻塞线程的代码。我们还对API和站点级别进行了大量性能改进,以帮助线程快速完成。最后,我们将网站部署到生产环境并获得了可接受的性能。

As some users pointed out here, the problem was thread exhaustion (aka thread contention). We tried to identify and amend any code that could block the threads. We also made loads of performance improvements to the API and site level to help the threads finish quickly. Finally we deployed the site to the production environment and got an acceptable performance.

这篇关于ASP.NET网站在负载下变得无法响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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