question

leodelciello-7930 avatar image
0 Votes"
leodelciello-7930 asked lextm edited

Relation between w3wp.exe and IIS Application pool

I used to assume that for any application pool started on IIS a new w3wp.exe process is started.
Is it correct ?
in an Asp.net web application the Global.asax.cs ' Application_Start () method should be called any time the application pool to which the web application belongs is started.
Is it Correct ?

windows-server-iis
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

lextm avatar image
0 Votes"
lextm answered lextm edited
  1. "any application pool started on IIS a new w3wp.exe process is started" is wrong. A started application pool can have no w3wp.exe. By default, IIS only starts a worker process w3wp.exe when an initial HTTP request arrives for that application pool. Note that IIS might start multiple w3wp.exe if this pool allows multiple worker processes when multiple requests arrive.

  2. "in an Asp.net web application the Global.asax.cs ' Application_Start () method should be called any time the application pool to which the web application belongs is started" is completely wrong. That method is only called when the first ASP.NET request arrives (a pure HTML/CSS request won't) which not only triggers the worker process to be created but also trigger ASP.NET runtime to be loaded. Merely starting the application pool won't trigger any of that.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.