IIS 不为其他用户提供服务请求为什么一个用户调用 Web 服务
再会!
我有一个涉及第三方 SOAP Web 服务的应用程序。 Web 服务调用不是很快(一般为 1-3 秒)。我注意到,在这次调用期间,整个应用程序被“锁定”——IIS 不服务其他用户的请求。
我知道可以在另一个线程中或以异步方式调用 Web 服务,但对于 2-3 秒的调用来说似乎有点过分了。可能有一些 IIS 配置可以解决这个问题?
我在 Windows Server 2003 上使用 IIS 6.0。应用程序基于 ASP.NET MVC 2。
谢谢!
Good day!
I've an application where 3rd party SOAP web-service is involved. Web service call is not very fast (a 1-3 seconds in common). I noticed that during this calls the entire application is 'locked' -- IIS do not serve requests from other users.
I know that it is possible to call web service in another thread or in async way, but it seems to be an overkill for 2-3 seconds calls. May be there is some IIS configuration to resolve this?
I use IIS 6.0 on Windows Server 2003. Application is ASP.NET MVC 2 based.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简而言之:您有一个调用外部 SOAP Web 服务的 ASP.NET MVC 2 应用程序。您有一个用户(会话)调用一些控制器操作,该操作本身调用服务。在此调用期间,另一个用户(不同的会话)调用相同的操作,并且您说它应该等到第一个请求完成。这有点奇怪而且不太可能。
如果您正在使用会话并且有两个并发请求(来自同一 HTTP 会话),则可能会发生您所描述的行为。因为会话不是线程安全的 ASP.NET(这不是 MVC 的限制,它一直都是这样)将对来自同一会话的所有写入请求进行排队。这是博客文章< /a> 说明了这一点(在会话限制部分)
Just to get that straight: you have an ASP.NET MVC 2 application calling an external SOAP web service. You have one user (session) calling some controller action which itself calls the service. During this call another user (different session) calls the same action and you are saying that it should wait until the first request completes. That's kinda strange and unlikely.
The behavior you are describing could happen if you are using sessions and you have two concurrent requests (from the same HTTP session). Because session is not thread safe ASP.NET (and this is not a limitation of MVC it has always been like this) will queue all requests from the same session that are writing to it. Here's a blog post which illustrates this (in the Session Limitations section)
IIS 自动对入站 Web 请求进行线程分离。
如果您的 Web 服务器在请求期间没有响应,并且该请求需要两到三秒,那么听起来您的 Web 应用程序正在使用极高的 CPU 和/或内存,从而导致 Web 服务器陷入困境停止。
您的应用程序在做什么?也许提供一些代码?
IIS automatically threads separate inbound web requests.
If your web server is not responding for the duration of a request and that request is taking two or three seconds, then it sounds like your web application is using extremely high cpu and/or memory which is therefore causing the web server to grind to a halt.
What is your application doing? Maybe provide some code?