Do ASP.NET worker threads spend most of their active time in a blocked state?
asp.net, c#
Solution
Let's walk through how a web request to an ASPX page looks to a user and their browser.
The user navigates their browser to the ASPX page. On the server, IIS recognizes this as an ASP.NET request and routes it to the .NET handlers for processing, which includes taking a worker thread, processing the page, and delivering the resulting HTML back to the user's browser. This does not include delivering the actual images, JavaScript files, CSS files, and other external resources - just the resulting HTML from the page itself goes back to the user's browser.
When the user's browser renders the page, it will then make additional requests for the other resources on the page - images, JavaScript files, etc. When IIS receives the requests for these files, it will process them as static content, and therefore the ASP.NET handlers (and their worker processes) is not involved in processing or delivering the content.
Note that you can configure IIS to use the .NET handlers to process these types of requests, but for static content, IIS won't do that out-of-the-box.
Problem
I'm trying to determine the role of ASP.NET worker threads. My IIS 7 installation defaulted to allowing a maximum of 25 worker threads, whereas I would have otherwise set it to 1. When a user requests an `.aspx` page, I understand that that request will retrieve a worker thread. But does the loading of each of the images on that page also grab a worker thread? And once an image is retrieved, is the worker thread that retrieved it also responsible for transmitting it to the user (via blocking-tcp-sockets?)?