[SQL Server] I/O requests taking longer than 15 seconds to complete on file

Source: Internet
Author: User
Tags microsoft sql server 2005

What does the "I/O Request" error below represent?

 

13:26:42. 480 spid364
Microsoft SQL Server 2005-9.00.3177.00 (Intel x86)

16:30:02. 140 spid6s
SQL
Server has encountered 2 occurrence (s) of I/O requests taking longer
Than 15 seconds to complete on file [F:/SQL data files/xxx. MDF] In
Database [XXX] (5 ).

16:32:08. 780 spid6s
SQL
Server has encountered 2 occurrence (s) of I/O requests taking longer
Than 15 seconds to complete on file [h:/SQL data files/xxx_data_4.ndf]
In database [XXX] (5 ).

 

Research and findings

---------------------------------

These
Errors may occur as result of "CPU drift" and can be ignored and
Disabled, howerver, first verify both SQL dmv
SYS. dm_io_pending_io_requests and Windows performance counters don't
Indicate any Io delays.

 

On computers with multiple CPUs, the CPUs are designed to "sleep" during periods of low workload.
When
CPUs sleep, SQL may not accurately determine CPUs overall workload and
Incorrectly report this as IO warning shown above, however, this does
Not represent an actual CPU performance problem.

 

To
Confirm if the CPUs entered low-power state, SQL Server escalation
Services created rdtsc (read time stamp counter) utility to report total
CPU sleep time.
The report confirmed the CPUs were sleeping up to 24 seconds.
This wocould be enough for SQL Server to incorrectly report this a slow Io.
Both AMD's and Intel's web sites describe the ability for CPUs to sleep.

 

Rdtsctest.exe [-MD |-MT]

-MD detailed output (default)

-Mt cpu speeds in table format

 

-- Current CPU speeds --

Runtime CPU expectedmhz actualmhz rdtscticks driftms

--------------------------------------------------------------------------------

17:53:36 0 3502 3503 0x0001564772f87fa72 16123.4

17:53:36 8 3502 3506 0x00015647d8b7ae30d 23922.5

17:53:36 16 3502 3507 0x00015647b5feb4a39 21260.9

 

For more information on rdtsc can be found

Http://blogs.msdn.com/psssql/archive/2007/08/19/sql-server-2005-rdtsc-truths-and-myths-discussed.aspx

 

Starting
With SQL 2005 sp2 we 've got ded two trace flags to disable
Reporting of CPU drift errors in the SQL Server errorlog.

 

Disable this error using trace flag 8033

The time stamp counter of CPU on scheduler Id 1 is not synchronized with other CPUs.

 

Disable this error using trace flag 830

SQL Server has encountered 2 occurrence (s) of I/O requests taking longer than 15 seconds to complete

 

Bytes -------------------------------------------------------------------------------------------------------

 

 

In the majority of cases this warning indicates that an I/O operation
Has taken too long. This article looks at the possible reasons for this
And describes what can be done to reduce the likelihood of it
Recurring.

There is another possible reason that is not I/O related and this is briefly referred to at the end of the article.

Let's start by examining the reason behind it. I/O requests from SQL
Server are handled asynchronously by the operating system. This means
That
When a read or write request is made, the thread making it waits
The I/O to complete.

This frees CPU for use by another thread.
Optimally an I/O shocould take a few MS, but can take considerably more than this.
This warning is reported when the time between requesting an I/O and its completion is greater than 15 seconds.

The possible reasons for this are: I/O subsystem problems or
Misconfiguration, excessive I/O being requested by SQL Server, Data
Files Not
Optimally placed on the disk, and fragmentation.

I/O subsystem

The first thing to do is to examine the I/O subsystem. hardware errors
Are a common cause and you shoshould run diagnostics if you are at all
Suspicious that this might be the case.

Two common reasons for poor I/O throughput on a San are out of date
Firmware, and insufficient queue length on the HBA. Be aware that if you
Upgrade San firmware you often need to upgrade the HBA drivers at
Same time, or the server may fail to access the San altogether.
Contact the San vendor for confirmation and details.

Another common cause of poor I/O performance is if a file system filter
Driver has been installed. A filter driver intercepts requests before
They reach the file system, and performs additional processing such
Anti-virus checking and encryption. It goes without saying that this can
Only have a negative impact on I/O performance.

If you have to have anti-virus software installed on your SQL Server,
Ensure that MDF, NDF and LDF files are added to the exclusion list. Even
Better is for realtime virus checking to be disabled completely;
Schedule a regular scan during quiet times instead.

I/O Load

It is often the case that there are I/O issues at night, when batch
Jobs are running, but it performs well during the day with no warnings
In
Logs.

You may find that there are several jobs running at the same time,
Either through poor scheduling or because one or more jobs have overrun.
Provided there is sufficient free time you coshould reschedule one or more
Jobs and monitor for a couple
Days to see if it has made a difference.

This is more complicated in environments where a SAN is used by several
Servers, as it may be jobs running on non-SQL servers overloading
San
And causing your problems. In this case you need to discuss the problem
With the system administrators
Responsible for these servers and agree a schedule that is mutually
Acceptable.

Fragmentation

Fragmentation may be internal (within tables/indexes) or external (File fragmentation on the disk ).

Internal fragmentation is only a problem where in-order scans are being
Saved med, and only on large tables. The warning message that is
The subject of this article is unlikely to occur in this situation.
Best practice is to monitor logical fragmentation
And regularly rebuild or reorganize affected indexes.

Disk fragmentation can also be forced CED through best practice, such as presizing data files (Capacity Planning), and not
Using autoshrink
, Or manually shrinking database files.

If you suspect disk fragmentation may be causing performance problems, I can recommend diskeeper
.
This runs continuously in the background
Using idle CPU time only, and is able to defragment SQL server files
While they are in use. Your mileage may vary, but I have seen
Staggering improvements from running this tool.

I/O Configuration

Other best practice includes splitting tempdb into several files,
Putting data and log files on separate disks, placing clustered and
Non-clustered indexes in separate filegroups (on different disks ),
Keeping statistics up-to-date, etc.
All these will improve performance and some are described in
SQL Server Configuration

.

One last possibility

In a minority of cases there may not be an issue with I/O at all, but a problem caused by CPU drift. This is described in
This article
.

I stress that this is rare, and you shoshould always examine the possible causes of slow I/O described above.

Summary

This article has described some of the most common reasons"SQL Server has encountered n occurrence (s) of I/O requests taking
Longer than 15 seconds to complete on file <FILENAME> in database <dbname>"

.

In most cases this message is an accurate description of the problem, and reasons for slow I/O shoshould be investigated.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.