如何绑请求的线程通过Http.sys中,IIS和AS​​P.NET [英] How are threads tied to requests through Http.sys, IIS and ASP.NET

查看:238
本文介绍了如何绑请求的线程通过Http.sys中,IIS和AS​​P.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在读了很多关于node.js中有使用每个请求模型(Apache)的一个传统线程服务器使用一个事件循环的服务器之间,以及频繁的比较(Nginx等节点,龙卷风)。

I'm currently reading a lot about node.js. There is a frequent comparison between servers using a traditional thread per request model (Apache), and servers that use an event loop (Nginx, node, Tornado).

我想详细了解请求是如何在ASP.NET处理 - 从点它在HTTP.SYS收到一路攀升到它本身ASP.NET正在处理。我发现在HTTP.SYS MSDN文档和IIS有点欠缺,但也许今天我的谷歌富薄弱。到目前为止,我已经找到了最好的资源是<一后href=\"http://blogs.msdn.com/b/tmarq/archive/2007/07/21/asp-net-thread-usage-on-iis-7-0-and-6-0.aspx\">Thomas马夸特的博客。

I would like to learn in detail about how a request is processed in ASP.NET - from the point it is received in http.sys all the way up to it being processed in ASP.NET itself. I've found the MSDN documentation on http.sys and IIS a little lacking, but perhaps my google-fu is weak today. So far, the best resource I have found is a post on Thomas Marquardt's Blog.

任何人都可以更加清楚的话题,或点我到任何其他资源?

Could anyone shed more light on the topic, or point me to any other resources?

(对于这个问题的目的,我只是在IIS7与典型的综合管线兴趣)

(For the purposes of this question I'm only interested in IIS7 with a typical integrated pipeline)

推荐答案

从我的研究,到目前为止,它的我的理解是,当一个请求到达它被放入内核模式请求队列。据<一个href=\"http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/a2a45c42-38bc-464c-a097-d7a202092a54.mspx?mfr=true\">this,这避免了许多与当有请求的大量的上下文切换的问题(或进程或线程...),提供对事件触发的IO类似的好处。
从文章引用:

From my research so far, its my understanding that when a request comes in it gets put into a kernel-mode request queue. According to this, this avoids many of the problems with context switching when there are massive amounts of requests (or processes or threads...), providing similar benefits to evented IO. Quoted from the article:

每个请求队列对应一个
  应用程序池。应用程序池
  对应于一个请求队列
  内的HTTP.sys和一个或多个工作
  流程。

"Each request queue corresponds to one application pool. An application pool corresponds to one request queue within HTTP.sys and one or more worker processes."

所以,根据的是,每个请求队列可能有多个<一个href=\"http://webcache.googleusercontent.com/search?q=cache%3aAWL9sOagVXUJ%3atechnet.microsoft.com/en-us/library/cc735084%28WS.10%29.aspx+worker+process&cd=1&hl=en&ct=clnk&gl=us&source=www.google.com\">Worker流程。 (谷歌缓存)更多关于工作进程

So according to that, every request queue may have more than one "Worker Process." (Google cache) More on worker processes

从我的理解:


  • IIS公开赛创建一个请求队列
    (见下面的HTTP.SYS API)

  • 系统网站在IIS中配置对应一个工作进程

  • 网站/工作进程<一个href=\"http://madskristensen.net/post/Done28099t-use-the-ThreadPool-in-ASPNET.aspx#id_d9c9863f-d624-4ade-bdcc-0e990589380c\">shares线程池。

  • 一个线程从递交请求队列的请求。

下面是关于 IIS7的建筑很多伟大的信息

下面是关于 HTTP.SYS 一些更多的信息

Here is some more information about http.sys.

  • HTTP Server I/O Completion Stuff
  • Typical Server Tasks

开放式问题我还有:


  • 如何赫克不会改变IIS服务器头如果它使用HTTP.SYS? (见这个问题

  • How the heck does IIS change the Server header if it Uses HTTP.SYS? (See this question)

请注意:我不知道,如果/一个内核模式请求队列如何对应一个 IO完成端口,我假设每个请求将有自己的,但我不知道,所以我真的希望有人会更彻底地回答这个问题。我只是偶然在这个问题,似乎HTTP.SYS确实能使使用IO完成端口,应提供几乎所有事件触发IO(node.js的,Nginx的,lighttpd的,C10K,等...)具有相同的典型应用该类超支的。

Note: I am not sure if/how a "Kernel-mode request queue" corresponds to an IO completion port, I would assume that each request would have its own but I don't know, so I truly hope someone will answer this more thoroughly. I just stumbled on this question and it seems that http.sys does in fact use IO Completion ports, which should provide nearly all of the same benifits that evented IO (node.js, nginx, lighttpd, C10K, etc...) have.

这篇关于如何绑请求的线程通过Http.sys中,IIS和AS​​P.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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