Domanda

Attualmente sto leggendo molto su node.js. C'è un confronto frequente tra server utilizzando un tradizionale filo per richiesta di modello (Apache), e server che utilizzano un ciclo di eventi (Nginx, nodo, ciclone).

Mi piacerebbe conoscere in dettaglio di come una richiesta viene elaborata in ASP.NET - dal punto in cui viene ricevuto in HTTP.SYS tutta la strada fino ad esso in fase di elaborazione in ASP.NET per sé. Ho trovato la documentazione MSDN su http.sys e IIS un po 'carente, ma forse il mio google-fu è debole oggi. Finora, la miglior risorsa che ho trovato è un post su di Thomas Marquardt Blog .

Qualcuno potrebbe far luce sul tema, o indicarlo ad eventuali altre risorse?

(Ai fini di questa domanda mi interessa solo in IIS7 con una tipica gasdotto integrato)

È stato utile?

Soluzione

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:

"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."

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

From my understanding:

  • IIS Opens creates a request queue (see the http.sys api below)
  • A "Web Site" configured in IIS corresponds to one Worker Process
  • A Web Site/Worker Process shares the Thread Pool.
  • A thread is handed a request from the request queue.

Here is a lot of great information about IIS7's architecture

Here is some more information about http.sys.

Open questions i still have:

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

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top