IIS (Internet Information Services) · Advanced Operations

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.

Advanced 5 min Lesson 39 of 45Covers IIS 10 on Windows Server 2019/2022/2025 and Windows 10/11.
Before you start:Application PoolsLogging
0/45 in IIS
On this page · 5 min · Advanced

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#

PowerShellCurrent requests and counters from the command line Illustrative
# 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
Expected output
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#

  1. appcmd list requests shows long-running requests with URL and module.
  2. Here /reports/monthly has run for 18 seconds inside the ASP.NET Core module — the app (or its database) is slow, not IIS.
  3. Queue size 0 means IIS isn’t overloaded.
  4. 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#

Raising Queue Length to “fix” 503s

Requests just wait longer. Find why the app is slow.

Web garden for performance

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
PowerShell Illustrative
& "$env:windir\system32\inetsrv\appcmd.exe" list requests /elapsed:10000

Mini quiz#

Performance Tuning and Monitoring quizMultiple choice Question 1 of 1

Which counter shows requests waiting in HTTP.sys?

Score so far: 0/0

Want more? Practise all IIS MCQs · IIS interview questions

My notes#

Saved in this browser.

Progress is saved in this browser. Sign in to sync.