Whats New In 2.2.0 - Web Server Monitoring
Via Microsoft IIS Administration API 2.2.0
If you are unfamiliar with the API, check out our earlier post for an introduction.
The IIS team has been working on making the IIS Administration API more than just a tool for configuring IIS. The latest release enables users to collect web server health and performance data that is integral to keeping web servers running. This new data source opens up possibilities for IIS data reporting, management suite integration, and live monitoring systems.
Health and Performance Monitoring
An important aspect of running a web server is being able to measure whether the server is healthy, and this requires collecting a wide array of data. In the 2.2.0 release of the IIS Administration API, monitoring endpoints have been added that provide the data necessary to ensure that the web server is performing as expected. These new endpoints provide metrics that are considered the most relevant for web servers including network, cpu, memory, disk, and HTTP requests. Data can be retrieved for the web server as a whole or individually for web sites and application pools. With these new endpoints the IIS Administration API can serve the dual purpose of configuration and monitoring.
The data from the monitoring endpoints is focused on the web server rather than the entire machine. For instance, the web server endpoint returns the number of web server processes running on the machine, but it does not include any unrelated processes. This means web server administrators can measure resource usage that comes solely from the web server.
Documentation for these new endpoints is available at https://docs.microsoft.com/en-us/IIS-Administration/api/monitoring.
Web Server Monitoring (/api/webserver/monitoring)
The web server monitoring resource has fields that represent different categories of performance data including network, HTTP requests, memory, CPU, disk, and web server cache. This endpoint can be polled on a one second interval to obtain live aggregated usage data of the web server.
The snippet below is an example of the webserver monitoring resource.
{
"id": "{id}",
"network": {
"bytes_sent_sec": "1201162 ",
"bytes_recv_sec": "278429 ",
"connection_attempts_sec": "0 ",
"total_bytes_sent": "7722036030 ",
"total_bytes_recv": "1789971361 ",
"total_connection_attempts": "99 ",
"current_connections": "99 "
},
"requests": {
"active": "0 ",
"per_sec": "2870 ",
"total": "18453312 "
},
"memory": {
"handles": "35343 ",
"private_bytes": "721608704 ",
"private_working_set": "614633472 ",
"system_in_use": "3359817728 ",
"installed": "10642575360 "
},
"cpu": {
"threads": "2382 ",
"processes": "99 ",
"percent_usage": "3 ",
"system_percent_usage": "31 "
},
"disk": {
"io_write_operations_sec": "0 ",
"io_read_operations_sec": "0 ",
"page_faults_sec": "0 "
},
"cache": {
"file_cache_count": "198 ",
"file_cache_memory_usage": "1962 ",
"file_cache_hits": "36906658 ",
"file_cache_misses": "55360241 ",
"total_files_cached": "199 ",
"output_cache_count": "0 ",
"output_cache_memory_usage": "0 ",
"output_cache_hits": "0 ",
"output_cache_misses": "36906759 ",
"uri_cache_count": "198 ",
"uri_cache_hits": "36906359 ",
"uri_cache_misses": "400 ",
"total_uris_cached": "200 "
}
}
Web Site Monitoring (/api/webserver/websites/monitoring/{id})
The web site monitoring endpoint provides data for individual web sites. This is useful for drilling in and seeing how each web site is contributing to the total usage of the web server. Specifying the id of a web site in the URL limits the API's response to the web site with that id, however if no id is specified the endpoint can be used to query all web sites at once.
Note: Some performance data obtained from the web site endpoint may not be accurate if more than one web site is configured to run in the same application pool.
The API also exposes application pool monitoring data that is available from the /api/webserver/application-pools/monitoring/{id} endpoint. This resources behaves in the same manner as the web site monitoring resource.
Monitoring UI
Along with the introduction of monitoring endpoints, the web management tool at https://manage.iis.net has been updated to provide a live monitoring experience.