Monday, October 5, 2009

"Current Anonymous Users" and "Current Connections"

When you decide to test performance and capacity of your web application, there are two indications that shows the vital numbers of your application.

If you are new in performance tester or you already use performance counters in windows server, you may be confused about counters like "Current Anonymous Users" and "Current Connections". The worst thing is "Current Anonymous Users" counter shows different meanings in IIS 5.0 and IIS 6.0. If you are test on your local pc with IIS 5.0 you see different behaviours of the counter in IIS 6.0. Here is differences.

In IIS 5.0. Current Anonymous Users is the number of current anonymous HTTP connections. This number decreases when the connection is closed (for various reasons, such as when the connection explicitly closes or times out).
In IIS 6.0. Current Anonymous Users is the number of current anonymous requests being processed. This number decreases when the request is completed. (HTTP.sys and IIS user mode both provide numbers for this counter.)
In short, IIS 6.0 counts each request as a user, whereas IIS 5.0 counts each connection as a user.

Excerpted from http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/1e240a6e-834e-4e0d-ab2a-4335c573c06a.mspx?mfr=true
A typical scenario looks like:
  1. User requests a page
  2. Connection is established and "Current Connections" increase
  3. The request is being processed and "Current Anonymous Users" increase
  4. The request has been processed and "Current Anonymous Users" decrease
  5. The connection is idle for some time
  6. The connection is closed, and "Current Connections" decrease
Excerpted from http://www.gafvert.info/notes/current_connections_users.htm