eG Monitoring
 

Measures reported by MsSqlSesResTest

In the database context, the connection between the user process and the server process is called a session. The server process communicates with the connected user process and performs tasks on behalf of the users.

This test tracks the resource usage of each session through which you can identify the session that utilizes the maximum memory and CPU of the MS SQL server. In addtion, you can track the average memory and CPU time of all the sessions of the MS SQL server. Using this test, you can identify on an average how long the sessions have been waiting on the MS SQL server and the maximum time a session has waited on the MS SQL server.

The measures made by this test are as follows:

Measurement Description Measurement Unit Interpretation
Avg_Mem_Usage Indicates the average amount of memory that is currently used by all sessions of this MS SQL server. KB A high value indicates that one/more MS SQL session consumes high memory for executing the query. Use the detailed diagnosis of the Max_Mem_Usage_KB measure to identify which session is consuming maximum memory in the MS SQL server.

To considerably reduce the memory consumption of the session, you have to optimize the query displayed in the SQL TEXT column of the Detailed Diagnosis. To optimize the query, you would be required to do any one of the following:

  • Check the fragmentation activity of the disks of the MS SQL server
  • Add additional indexes to the MS SQL server or
  • Include a hint to the query which would considerably reduce the memory usage of the server.
Max_Mem_Usage_KB Indicates the maximum memory used by the SQL server sessions. KB The detailed diagnosis of this measure, if enabled, displays the session ID, the name of the database accessed by the session, the login name of the user who initiated the session, the login time of the user, the request start time, when the session was established, the session wait time and type, the session duration, the time for which the session hogged the CPU, the memory usage of the session, the session status, the total number of reads, writes, and logical reads performed by the session on the database, and the query executed by the session. From this information, you can easily identify the session that is consuming the maximum CPU/memory, the session that has been waiting for the maximum time for the query to execute, the session that has performed the maximum I/O activities on the SQL server, and the query that is responsible for all such resource-intensive tasks.
Avg_Cpu_Time Indicates the average time for which the SQL sessions used the CPU resources of the SQL server. Seconds A high value indicates that one/more MS SQL sessions are hogging the CPU. Use the detailed diagnosis of the Max CPU time measure to identify which session is consuming the CPU resources excessively.

To reduce the CPU consumption of a session, you may have to optimize the query displayed in the SQL TEXT column of the detailed diagnosis. To optimize the query, you would be required to do any one of the following:

  • Check the fragmentation activity of the disks of the MS SQL server
  • Add additional indexes to the MS SQL server or
  • Include a hint to the query which would considerably reduce the CPU time usage of the server.
Max_Cpu_Time_Sec Indicates the maximum time for which the SQL sessions used the CPU. Seconds The detailed diagnosis of this measure, if enabled, displays the session ID, the name of the database accessed by the session, the login name of the user who initiated the session, the login time of the user, the request start time, when the session was established, the session wait time and type, the session duration, the time for which the session hogged the CPU, the memory usage of the session, the session status, the total number of reads, writes, and logical reads performed by the session on the database, and the query executed by the session. From this information, you can easily identify the session that is consuming the maximum CPU/memory, the session that has been waiting for the maximum time for the query to execute, the session that has performed the maximum I/O activities on the SQL server, and the query that is responsible for all such resource-intensive tasks.
Avg_Wait_Time Indicates the average time for which the SQL sessions were waiting. Seconds A high value indicates that one/more MS SQL sessions are waiting too long to perform a task – typically, to execute a query. Use the detailed diagnosis of the Max wait time measure to identify which session is taking too long for query execution.

To reduce the wait time of a session, you may have to optimize the query displayed in the SQL TEXT column of the detailed diagnosis. To optimize the query, you would be required to do any one of the following:

  • Check the fragmentation activity of the disks of the MS SQL server
  • Add additional indexes to the MS SQL server or
  • Include a hint to the query which would considerably reduce the wait time of the server.
Max_Wait_Time_Sec Indicates the maximum time for which the SQL sessions waited. Seconds The detailed diagnosis of this measure, if enabled, displays the session ID, the name of the database accessed by the session, the login name of the user who initiated the session, the login time of the user, the request start time, when the session was established, the session wait time and type, the session duration, the time for which the session hogged the CPU, the memory usage of the session, the session status, the total number of reads, writes, and logical reads performed by the session on the database, and the query executed by the session. From this information, you can easily identify the session that is consuming the maximum CPU/memory, the session that has been waiting for the maximum time for the query to execute, the session that has performed the maximum I/O activities on the SQL server, and the query that is responsible for all such resource-intensive tasks.
Avg_io_time Indicates the average time taken by current queries for I/O processing. Seconds A low value is desired for this measure. A high value indicates that one/more queries are I/O-intensive.
Max_io_time Indicates the maximum time that the current queries took for I/O processing. Seconds If the value of this measure exceeds 10 seconds, you will have to check the disk I/O subsystem for the proper placement of files – LDF and MDF on separate drives, tempDB on a separate drive, hot spot tables on separate filegroups. I/O can also be reduced if the SQL server uses cover index instead of cluster index.