Published on

January 27, 2011

Understanding SQL Server IO and ASYNC_IO_COMPLETION

When it comes to optimizing 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, disk upgrades are often necessary to improve space, speed, or throughput. In this article, we will explore an important IO-related wait type called ASYNC_IO_COMPLETION.

According to the SQL Server Book On-Line, ASYNC_IO_COMPLETION occurs when a task is waiting for I/Os to finish. This wait type can occur when an application connected to SQL Server is processing data slowly or during long-running database operations such as BACKUP, CREATE DATABASE, ALTER DATABASE, and others.

To reduce ASYNC_IO_COMPLETION wait, it is important to examine the following aspects associated with the IO subsystem:

  1. Check the application code for any inefficiencies that may be causing slow data processing. Inefficient loops or other coding issues should be addressed to avoid this wait type.
  2. Ensure proper placement of files. 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.
  3. Analyze File Statistics to identify any higher IO Read and IO Write Stall. This can be done using the fn_virtualfilestats function.
  4. Review event logs and error logs for any IO-related errors or warnings.
  5. If 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.
  6. Ensure that proper indexes are in place. Creating appropriate indexes can greatly reduce IO bandwidth. Consider using cover indexes instead of clustered indexes when possible.

In addition to these steps, it is also important to monitor memory and disk-related performance counters. Some key counters to monitor include:

Memory Related Perfmon Counters:

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

Disk Related Perfmon Counters:

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

By monitoring and optimizing these performance counters, you can identify and address any potential IO-related issues in 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. For further clarification, it is recommended to consult the SQL Server Book On-Line. Additionally, it is always advisable to test any changes on a development server before implementing them on a production server.

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.