IIS Express 7.5不能同时处理请求 [英] IIS Express 7.5 not processing requests concurrently

查看:68
本文介绍了IIS Express 7.5不能同时处理请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅安装了IIS Express 7.5,并试图调试ASP.NET MVC 3应用程序中的并发问题.但是,我似乎无法让Web服务器同时处理请求,它们只是一个接一个地执行.

Just installed IIS Express 7.5 and am trying to debug a concurrency issue in an ASP.NET MVC 3 application. I don't however seem to be able to get the web server to process requests concurrently, they just get executed one by one.

我正在运行Apache Bench来模拟并发负载,但是它正在排队.

I'm running Apache Bench to simulate a concurrent load but it's just getting queued up.

有人有什么主意吗?

谢谢.

推荐答案

如果您正在使用会话并为并发请求重用Session ID,则ASP.NET将对请求进行排队,因为它需要每个会话都具有独占锁定请求.

If you are using sessions and reusing the Session ID for your concurrent requests, ASP.NET will queue the requests because it needs an exclusive lock on the session for each request.

来自 http://msdn.microsoft.com/zh-CN/library/ms178581.aspx

并发请求和会话状态

每个会话对ASP.NET会话状态的访问是独占的,这意味着 如果两个不同的用户同时发出请求,则可以访问每个 并发地授予单独的会话.但是,如果两个并发 对同一会话发出请求(通过使用相同的SessionID 值),第一个请求将获得对该会话的独占访问权限 信息.第二个请求仅在第一个请求之后执行 完成.(如果独占,第二个会话也可以访问 因为第一个请求超过了,所以释放了对信息的锁定 锁定超时.)如果@页面中的EnableSessionState值 指令设置为ReadOnly,这是对只读会话的​​请求 信息不会导致会话数据互斥锁定. 但是,对会话数据的只读请求可能仍然需要等待 通过读写请求设置的锁定来清除会话数据.

Access to ASP.NET session state is exclusive per session, which means that if two different users make concurrent requests, access to each separate session is granted concurrently. However, if two concurrent requests are made for the same session (by using the same SessionID value), the first request gets exclusive access to the session information. The second request executes only after the first request is finished. (The second session can also get access if the exclusive lock on the information is freed because the first request exceeds the lock time-out.) If the EnableSessionState value in the @ Page directive is set to ReadOnly, a request for the read-only session information does not result in an exclusive lock on the session data. However, read-only requests for session data might still have to wait for a lock set by a read-write request for session data to clear.

这篇关于IIS Express 7.5不能同时处理请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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