Performance Tuning and Monitoring
When a site gets slow, first measure where the time goes: in IIS, in the app, or waiting for the database.
On this page · 5 min · Advanced
On this page
- Learning objectives
- Explanation
- Step-by-step screens
- Code example
- Step by step
- Real-world use
- Common mistakes
- Best practices
- Remember this
- Practice exercise
- Mini quiz
- Related topics
- My notes
- Reading time
- 5 min
- Difficulty
- Advanced
- Updated
- Nov 26, 2026
Related tutorials
Interview questions
Learning objectives#
- See running requests in Worker Processes
- Watch the key performance counters
- Tune pool queue and process settings
- Know when not to use a web garden
Explanation#
Server node → Worker Processes lists each w3wp.exe with its application pool, CPU and memory. Right-click → View Current Requests shows every request in progress, its URL, how long it has run and which module it is in — long-running requests stand out immediately.
Performance Monitor counters to watch: HTTP Service Request Queues\CurrentQueueSize (requests waiting — should be near 0), W3SVC_W3WP\Active Requests, Process(w3wp)\% Processor Time and Private Bytes, and for ASP.NET Core the dotnet-counters tool.
Queue Length (1000 by default) is how many requests may wait before IIS returns 503. Raising it only hides a slow app; fix the slowness. Maximum Worker Processes > 1 (a web garden) splits memory caches and session state and rarely helps modern apps.
Cheap wins: enable static and dynamic compression, cache static files in the browser, and make sure the app isn’t running in Debug mode.
Step-by-step screens#
Drawings of IIS Manager in IIS 10 (Windows Server 2019/2022, Windows 10/11). The red numbers match the numbered actions under each picture; names on your computer will differ.
Loading pictures…
Code example: Current requests and counters from the command line#
# Requests running longer than 5 seconds
& "$env:windir\system32\inetsrv\appcmd.exe" list requests /elapsed:5000
# Sample key counters every 5 seconds, 6 times
Get-Counter -Counter @(
'\HTTP Service Request Queues(*)\CurrentQueueSize',
'\W3SVC_W3WP(*)\Active Requests',
'\Process(w3wp*)\% Processor Time',
'\Process(w3wp*)\Private Bytes'
) -SampleInterval 5 -MaxSamples 6
REQUEST "f20000038000c3d2" (url:GET /reports/monthly, time:18312 msec, client:10.0.0.24, stage:ExecuteRequestHandler, module:AspNetCoreModuleV2) \web01\http service request queues(shoppool)\currentqueuesize : 0 \web01\w3svc_w3wp(5324_shoppool)\active requests : 14 \web01\process(w3wp)\% processor time : 22.4
This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.
Step-by-step explanation#
- appcmd list requests shows long-running requests with URL and module.
- Here /reports/monthly has run for 18 seconds inside the ASP.NET Core module — the app (or its database) is slow, not IIS.
- Queue size 0 means IIS isn’t overloaded.
- Active requests and CPU show the load.
Real-world use case#
Users reported slowness at 10 AM. View Current Requests showed 40 requests stuck on /reports/monthly; a missing SQL index was found and the page went from 18 s to 300 ms.
Common mistakes#
Requests just wait longer. Find why the app is slow.
Multiple processes duplicate caches and break in-memory sessions. Use one process and scale out with more servers.
Best practices#
- Measure before tuning
- Watch queue size and active requests
- Compression and client caching
- One worker process per pool
Remember this#
Worker Processes → View Current Requests.
CurrentQueueSize should be ~0.
Web garden rarely helps.
Practice exercise#
Your task: List requests that have been running for more than 10 seconds.
Show solution
& "$env:windir\system32\inetsrv\appcmd.exe" list requests /elapsed:10000
Mini quiz#
Which counter shows requests waiting in HTTP.sys?
Want more? Practise all IIS MCQs · IIS interview questions
My notes#
Saved in this browser.