How to rapidly estimate the present quantity of person connections (periods) to the IIS websites on webserver operating on Windows Server? Such info will permit to decide and predict the load on the server, select one of the best time for the upkeep and updates of the web site, predict the IIS server’s load when the quantity of customers will increase.
The easiest method to decide the quantity of lively person periods on the IIS Web site is to use the efficiency counters in Windows Performance Monitor.
Open the Performance Monitor console by operating the perfmon command and go the Performance monitor part (Monitoring Tools — > Performance Monitor).
Then you want to add the mandatory counters to the monitor window (by default, the overall CPU utilization counter is displayed, however you may take away it). To add a brand new counter, click on the inexperienced button on the toolbar (you may see it on the screenshot) or press Ctrl+N on the keyboard.
In the record of out there counters, discover and increase the Web Service group. In this class, we’re serious about three counters:
- Current Anonymous Users – the quantity of nameless IIS customers;
- Current Non-Anonymous Users – the quantity of licensed IIS customers;
- Current Connections – complete quantity of lively connections on the IIS server.
Select the specified counter and within the Instances of chosen objects select a number of IIS web sites, for which you need to show connection info. The details about customers of all web sites on the server is saved within the _Total occasion. Now you solely have to click on the Add >> button to transfer the counter to the record of the counters to be added in the suitable pane.
Add all the mandatory counters in the identical approach and click on OK.
Now within the Performance Manager console, the details about the quantity of person periods is displayed in the true time (by default, the counter values are displayed as linear graphs). If you choose any of the counters within the backside pane, you may view its final, common, minimal or most worth for a given interval of time.
You can add customized efficiency counters to this console and save them in a separate view, which can be utilized later to rapidly entry the online server load knowledge.
You can entry the IIS efficiency counters from PowerShell. To do that, you should use the Get-Counter cmdlet. The record of all out there Web Service efficiency counters will be displayed as follows:
(Get-Counter -ListSet 'Web Service').counter
To get details about the present quantity of lively connections on the IIS server (the counter Web Service
Get-Counter -Counter “Web Service
As you may see, this command returned each the overall quantity of connections to the IIS server and the statistics for every of the websites.
- The values of a number of counters will be displayed in case you specify them separated by the commas;
- With the –Continuous choice, the details about the worth of the counter is continually displayed within the console until you interrupt it utilizing CTRL+C.
You can get the quantity of lively periods for a particular IIS site. For instance, to get the present quantity of connections on a site named Site1, run the next command:
Get-Counter "internet service(Site1)present connections" -PcName web-srv01
You can specify the identify of the server on which the counter worth is checked. When you checking the quantity of connections on the site domestically, specifying localhost isn’t allowed:
In order not to specify the server identify every time, you should use the setting variable COMPUTERNAME:
Get-Counter "internet service(Site1)present connections" -PcName $env:COMPUTERNAME
To get the numeric worth of the counter “present connections” of the whole IIS internet server (complete customers on IIS), you should use this command:
((Get-Counter -Counter 'internet service(_total)present connections' -computer $env:COMPUTERNAME) | Select-Object -Expand countersamples).Cookedvalue
Let’s attempt utilizing a easy script to create a number of extra periods with our site and verify the counter worth. You can enhance the quantity of connections to the IIS web site utilizing the cmdlet, or you may merely open a number of home windows within the browser:
$counter = 20
for($i=1;$i -le $counter;$i++)
Check the worth of the present connections counter and be sure that it will increase.
If , and also you want to get the quantity of connections to every of them in a desk kind, you should use this script (to obtain knowledge from IIS into PowerShell, you want to load the WebAdministration module):
$IISsites = dir IIS:Sites | Select Name
$CurrentConnection = @()
foreach ($site in $IISsites)
get-CurrentConnection -Site $site.identify
$CurrentConnection += $ConnCount
You also can show the numerical values of connection counters for all websites (the primary worth is the overall quantity of connections to IIS):
Get-wmiObject -class Win32_PerfRawData_W3SVC_WebService | select-object -expand currentconnections
You can show details about the quantity of obtained/despatched knowledge for every site or the whole internet server utilizing the
Web service(sitename)Bytes Received/sec and
Web service(sitename)Bytes Sent/sec counters.
So, we checked out a approach to get details about the load on websites operating on the IIS internet server.
When attempting to configure a brand new host within the RDS farm working Windows Server …