Resolve SQL Server I/O bottleneck issues
Situation:
Nowadays, most of the SQL Server environment is running on virtualized environment. VMWare, Hyperviser, Xen, Elastic compute cloud etc. are the most popular virtualization platform available in the market. As per the recommended best practice, we should have separate dedicated drives for SQLTemp, SQLData, SQLLog, SQLBinary & SQLBackups. All these drives should be presented as individual LUNs to provide the best I/O throughput to the SQL Server. In-spite of implementing these best practices, SQL Server frequently encounters disk I/O latencies issues in most of the environments. We can see following error in the SQL Server error logs:
SQL Server has encountered xxx occurrence(s) of I/O requests taking longer than 50 seconds to complete on file [D:\MSSQL\MSSQL.1\MSSQL\Data\MyProdDB.mdf] in database [database]. The OS file handle is 0x00000000. The offset of the latest long I/O is: 0x00000000000000
Solution:
There are many Dynamic management views (DMVs) and SQL Server blogs are available to deep dive into the I/O latency issues. However, many times issue is laying around the disk block size. If the disk block size is not properly configured then SQL server will encounter massive I/O performance issues. By default, Windows format the drives with the default block size 4KB.
we can check the current block size with the below command. Open cmd window in administrative mode and run this command:
> fsutil fsinfo ntfsinfo D:
The output of this command is as below:
= Bytes Per Cluster / Bytes per FileRecord Segment
The block size of D: drive is 4KB (4096/1024).
In the virtualized environment like VMWare, SQL Server is designed to produce maximum I/O throughput with the 64KB block size. We can format all the SQL dependent drives by selecting 64 Kilobytes in "Allocation unit size".
Now we can use these formatted drives for our new SQL Server installation.
Comments
Post a Comment