gpt4 book ai didi

iis-express - IIS Express 7.5 不同时处理请求

转载 作者:行者123 更新时间:2023-12-03 13:58:35 25 4
gpt4 key购买 nike

刚刚安装了 IIS Express 7.5 并尝试调试 ASP.NET MVC 3 应用程序中的并发问题。然而,我似乎无法让 Web 服务器同时处理请求,它们只是被一一执行。

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

有人有什么想法吗?

谢谢。

最佳答案

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

取自 http://msdn.microsoft.com/en-us/library/ms178581.aspx

Concurrent Requests and Session State

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 - IIS Express 7.5 不同时处理请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9672566/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com