Friday, January 14, 2011

SQL ASP State - Perfmon for Active User Sessions

Hi guys,

we have an IIS web farm (two servers at the moment) set up to use SQL ASP State for the Session info. When I query the ASP State database table I can see the number of sessions being managed by the database.

Is there an associated Performance monitor that I can use to get the same information or is the best way to do it via a SQL Query?

I've tried setting up perfmon on the Web servers and the SQL Server and monitored everything that even sounds like Session, including:

\\WebServerA\ASP.NET Apps v2.0.50727(__Total__)\Session SQL Server connections total
\\WebServerA\ASP.NET Apps v2.0.50727(__Total__)\Sessions Active
\\WebServerB\ASP.NET Apps v2.0.50727(__Total__)\Session SQL Server connections total
\\WebServerB\ASP.NET Apps v2.0.50727(__Total__)\Sessions Active
\\WebServerB\ASP.NET State Service\State Server Sessions Active
\\WebServerB\ASP.NET v2.0.50727\State Server Sessions Active
\\SQLServer\ASP.NET Apps v2.0.50727(__Total__)\Session SQL Server connections total
\\SQLServer\ASP.NET Apps v2.0.50727(__Total__)\Sessions Active
\\SQLServer\ASP.NET State Service\State Server Sessions Active

All counters remain on 0 while running a performance test simulating 50 users, while at the same time I can see 50 sessions being created by querying the SQL session table.

Edit: The "Session SQL Server connections total" counters on the Web Servers do go up when the test is running, but it doesn't actually track the number of users (obviously, I know, but I was hoping for something)

  • Your best bet will be to query the SQL Server as this will be the most reliable information as the database is the authoritative source of this information at this point.

    Gineer : Will that not affect the performance of the ASP State Database? Since this is the central state store for all servers in the farm, it obvioulsy needs to be fast. Are you telling me that there simply is no performance counter for this or were you just giving your opinion?
    mrdenny : SQL Won't provide a counter, and that would be the only server that has all the information about all the web servers in the farm. It shouldn't slow down the database as the ASPState database is very small, and it should all be sitting in the SQL Server Buffer Cache.
    From mrdenny
  • I've done a simlar search on http://msdn.microsoft.com/newsgroups and found the same answer there: How to count the active ASP.NET Sessions (SQL Server)?

    It Seems that querying SQL is the only way to get this information. I suppose the only other way to do this would be to create a custom performance counter. I figure if that was a good idea, Microsoft would have simply created the counter?!? No?

    From Gineer

0 comments:

Post a Comment