When checking for performance and issues, you must figure out how many active connections there are to your IIS website. If it’s too high, you should know that it’s time to work on your server.
To check the number of active connections, there’s a really useful tool called Performance Monitor. Here, you’d have to set the number of counters. Another technique for checking the connections is PowerShell. In this article, learn more about the techniques.
Using the Performance Monitor Tool
Here are the steps you need to follow:
Using Powershell
Powershell is another way you can see the number of active connections. Here are the steps to follow:
So that’s how you check for the number of connections on your IIS website.
To check the number of active connections, there’s a really useful tool called Performance Monitor. Here, you’d have to set the number of counters. Another technique for checking the connections is PowerShell. In this article, learn more about the techniques.
Using the Performance Monitor Tool
Here are the steps you need to follow:
- Press Windows+R
- Search for ‘Perfmon’ and click Enter
- Located the ‘+’ green button on the toolbar and click on it. Doing so will add the counters. These will count and show you the number of user sessions that are active
- Next, expand the Web Service group and you’ll see a list of available counters. You can select as many counters as you want, but we recommend using the following three counters at the bare minimum:
- Current Anonymous Users
- Current Non-Anonymous Users
- Current Connections
- To start adding the counters, select the desired counter. Then, for the field ‘Instances of selected objects’, select the IIS website.
- Repeat the above step for other counters
Using Powershell
Powershell is another way you can see the number of active connections. Here are the steps to follow:
- Open Powershell by clicking on the icon
- Insert this command -
Code:
(Get-Counter -ListSet 'Web Service').counter
- Then, write the following line to check the number of active sessions -
Code:
Get-Counter "web service(Site1)current connections" -ComputerName web-srv01
- Or, you can use this command if you want to check the number of connections on your local website -
Code:
Get-Counter "web service(Site1)current connections" -ComputerName $env:COMPUTERNAME
- To know the number of active connections on your IIS server, use this line -
Code:
((Get-Counter -Counter 'web service(_total)current connections' -computer $env:COMPUTERNAME) | Select-Object -Expand countersamples).Cookedvalue