Hi @Nicola Sergio ,
Does w3wp.exe pull requests from HTTP.sys request queue through a syscall? Or does HTTP.sys push the request from the queue to the process?
It’s a pull model.
HTTP.sys receives incoming HTTP requests and places them into a request queue, then passes them to IIS for processing.
The worker process (w3wp.exe) retrieves requests from its assigned queue. HTTP.sys does not push requests into the process.
In the pull model, how does the process pull requests headed to it?
Each application pool has its own request queue inside HTTP.sys, and requests are routed to the correct queue based on the configuration.
When a worker process starts, it is given a handle to its queue.
Worker threads in w3wp.exe issue receive calls against that queue. These calls either block until a request is available or complete asynchronously when a request arrives.
At the HTTP API level, this is exposed through functions like HttpReceiveHttpRequest, which retrieves the next available request from the specified queue.
Does this involve a syscall between user mode and kernel mode?
Yes.
The worker process runs in user mode and calls into the HTTP API, which transitions into kernel mode to communicate with HTTP.sys and retrieve the request.
So in short:
- HTTP.sys (kernel) receives and queues requests
- WAS manages processes but does not forward requests
- w3wp.exe (user mode) pulls requests from its queue using blocking or async calls
- there is no push from HTTP.sys into the worker process