Monitoring Web Applications in ASP.NET

Discussion in 'ASP.NET' started by MinalS, Feb 11, 2015.

  1. MinalS

    MinalS New Member

    Jul 8, 2014
    Likes Received:
    Trophy Points:
    Once the web application is deployed, the admin monitors the functioning of the application. Through monitoring, user can detect the problems that occur in an application and resolve them. For monitoring a web application, ASP.NET provides the following two features.
    1. Health monitoring
    2. Performance monitoring

    1. Health monitoring

    Health monitoring helps user to monitor the status of the deployed web applications. User can track the system errors and events. The detailed run time information of the ASP.NET resources is provided. The System.Web.Management namespace contains the implementation of the heath monitoring system. It contains the classes and interfaces for managing the health of the web application. The web events can be captured using the built in event providers.

    Configuration of Health Monitoring

    The configuration of applications are used for the built in or customized monitoring providers. They process the health monitoring information and report the health status and the performance characteristics.

    The following configuration jobs are to be performed while using the health monitoring.
    1. Configure and enable web events to be monitored
    2. Configure and enable event providers used for listening and processing several web events.
    The following code snippet demonstrates the configuration of health monitoring through the <healthMonitoring> element.
    	enabled = “true | false”
    	heartbeatInterval = “time interval” >
    The following list shows the attributes of the <healthMonitoring> element.
    1. enabled: It specifies whether health monitoring is enabled or not.
    2. heartbeatInterval: It specifies the interval, in seconds indicating the WebHeartBeatEvent interval.
    The child elements of the <healthMonitoring> element are as mentioned below:
    1. bufferModes: It specifies the buffering capacity of the provider
    2. profiles: It defines the collection of parameter sets for configuring events
    3. eventMappings: It maps the event names for the related event types
    4. rules: It maps events to the providers
    5. providers: It states the health monitoring providers that process the events.
    Event Providers

    The event providers are used for listening the web events that are raised by an application. There are several listeners provided by the ASP.NET used for capturing web events raised by the web application.

    Some of the built in providers in the system are as listed below:
    1. EventLogWebEventProvider: It is used to log the web events in the Windows event log.
    2. SqlWebEventProvider: It is a web event provider for SQL Server databases.
    3. SimpleMailWebEventProvider: It is used for sending response to the email messages.
    4. TraceWebEventProvider: It sends the web events to the diagnostics trace.
    5. WmiWebEventProvider: It sends the web events to the WMI subsystem.
    The following code snippet demonstrates the EventLogWebProvider in the configuration file.
    <healthMonitoring enabled = “true” heartbeatInterval = “0” >
    		<add name = “New Device “ eventName = “Device Value” 
    		provider = “EventLogProvider” profile =”Default” minInterval = “00:02:00” />
    In the above code, the <rule> element is the child element. The rule creates an handle for the Device Value.

    2. Performance Monitoring

    Performance is useful in the success of a project. There are performance counters for tracking the execution of the web application. The counters can be application restarts, requests queued, and error totals.

    The following groups of the performance counters are supported by ASP.NET.
    1. System Performance counters
    2. Application Performance counters
    1. System Performance counters

    The system performance counters are displayed in the Windows Performance monitor form of the ASP.NET.

    Some of the system performance counters are as listed below:
    1. Requests Disconnected: It states the number of requests that have been disconnected due to the failure in communication
    2. Request Wait State: It states the number of milliseconds that the most recent request waited in the queue.
    3. State Server Session Active: It represents the number of user sessions that are inactive due to some action.
    4. Application Running: It states the number of applications running simultaneously on a web server.
    5. Worker Process Running: It states the number of worker processes running on a web server.
    2. Application Performance Counters

    The performance counters in ASP.NET application are displayed in the application performance object. A unique instance of the application collects the counter of an application.

    Some of the application performance counters are listed below:
    1. Anonymous Requests / Sec: It represents the number of requests per second that are using the anonymous authentication.
    2. Cache Total Entries: It states the total number of entries in a cache.
    3. Cache Total Hits: It represents the total number of hits from the cache.
    4. Debugging Requests: It states the number of requests that occur in enabled debugging.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice