Published on

January 29, 2011

Understanding SQL Server IO and Performance

When it comes to optimizing the performance of a SQL Server system, there are three key factors to consider: CPU, Memory, and IO (disk). While CPU and Memory upgrades are not frequently required, the disk is often upgraded to improve space, speed, or throughput. In this article, we will focus on IO-related wait types and explore ways to reduce IO_COMPLETION waits.

IO_COMPLETION wait type occurs when tasks are waiting for I/O operations to complete. This wait type typically represents non-data page I/Os. Data page I/O completion waits appear as PAGEIOLATCH_* waits. If you encounter IO_COMPLETION waits, it is a clear indication that the IO subsystem needs attention.

To reduce IO_COMPLETION waits and improve IO performance, consider the following steps:

  1. Proper Placement of Files: Ensure that the files are placed correctly on the file system. Separate the LDF and MDF files onto different drives, place TempDB on a separate drive, and consider placing hot spot tables on a separate filegroup and disk.
  2. Check File Statistics: Use the fn_virtualfilestats function to check for higher IO Read and IO Write Stall. This will help identify any potential issues with the IO subsystem.
  3. Review Event and Error Logs: Check the event log and error log for any errors or warnings related to IO. This can provide valuable insights into any underlying issues.
  4. SAN Throughput and Configuration: If you are using a SAN (Storage Area Network), check the throughput of the SAN system and the configuration of the HBA Queue Depth. Adjusting the HBA Queue Depth can significantly improve performance.
  5. Create Proper Indexes: Ensure that there are appropriate indexes in the system to reduce IO bandwidth. Table scans and heap scans can be minimized by creating proper indexes. Consider using cover indexes instead of clustered indexes to further optimize performance.

Additionally, monitoring memory and disk-related performance counters can provide further insights into system performance. Some key memory-related counters to monitor include:

  • SQLServer: Memory Manager\Memory Grants Pending (Consistent higher value than 0-2)
  • SQLServer: Memory Manager\Memory Grants Outstanding (Consistent higher value, Benchmark)
  • SQLServer: Buffer Manager\Buffer Hit Cache Ratio (Higher is better, greater than 90% for a usually smooth running system)
  • SQLServer: Buffer Manager\Page Life Expectancy (Consistent lower value than 300 seconds)
  • Memory: Available Mbytes (Information only)
  • Memory: Page Faults/sec (Benchmark only)
  • Memory: Pages/sec (Benchmark only)

Similarly, some key disk-related counters to monitor include:

  • Average Disk sec/Read (Consistent higher value than 4-8 milliseconds is not good)
  • Average Disk sec/Write (Consistent higher value than 4-8 milliseconds is not good)
  • Average Disk Read/Write Queue Length (Consistent higher value than benchmark is not good)

By monitoring these counters and taking appropriate actions, you can optimize the performance of your SQL Server system.

It is important to note that the information presented in this article is based on personal experience and may vary from system to system. It is recommended to test any changes on a development server before implementing them on a production server. For further clarification, refer to the SQL Server Book Online documentation.

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.