sql数据库磁盘响应时间长

介绍 (Introduction )

As DBAs, we all get to the point where we are asked to setup a new server for a specific environment. Setting up a new server is not a big thing but giving the answer to the question that “how well it will work” might be tricky.

作为DBA,我们所有人都被要求为特定环境设置新服务器。 设置新服务器不是一件大事,但是要回答“它将如何运行”这个问题可能会很棘手。

There are tons of items which we can setup to measure how well the newly installed server will response but here I will discuss one of the most important resource of the server “Disk”. Most often the disk is not measured correctly or I have seen environments where the disk response time has never been measured. I will discuss here a tool from Microsoft which is very handy and can solve your problem very quickly. The diskspd.exe!

我们可以设置很多项目来衡量新安装的服务器将如何响应,但是在这里,我将讨论服务器“磁盘”的最重要资源之一。 大多数情况下,磁盘测量不正确,或者我见过从未测量过磁盘响应时间的环境。 我将在这里讨论Microsoft提供的一种非常方便的工具,它可以很快解决您的问题。 diskspd.exe!

It’s the superseding version of SQLIO which was previously used to measure IO response time for disk. The source code of diskspd.exe is hosted on GitHub. You can download this free utility from Microsoft’s website using this link.

它是SQLIO的替代版本,以前用于衡量磁盘的IO响应时间。 diskspd.exe的源代码托管在GitHub上 。 您可以使用此链接从Microsoft网站下载此免费实用程序。

After you will download the utility you will get a zip file. Just unzip the file and it will give you the folders and files as shown in the below screenshot. You will be needing the exe of diskspd inside the folder “amd64fre” if you have a SQL Server 64-bit version (most of us will be having this).

下载该实用程序后,您将获得一个zip文件。 只需解压缩文件,它将为您提供文件夹和文件,如以下屏幕截图所示。 如果您使用的是SQL Server 64位版本,则需要在“ amd64fre”文件夹中使用diskspd的exe文件(我们大多数人都拥有该版本)。

让我们开始吧 (Let’s get started)

Now we can start the actual tests using the utility. To simplify things for the test we can copy appropriate executable file to a folder in C Drive like “C:\diskspd_test” and create a folder in the drive which you want to test like for this instance H Drive and I created a folder TestLoad in H Drive.

现在,我们可以使用该实用程序开始实际测试。 为了简化测试,我们可以将适当的可执行文件复制到C驱动器中的文件夹,例如“ C:\ diskspd_test”,并在要测试的驱动器中创建一个文件夹,例如本实例H Drive,并在其中创建一个文件夹TestLoad。 H盘。

The utility is capable enough to create a good load file for you and test it for read and write. Though there are many ways to customize your testing but I will suggest you to start with a simple yet with solid results.

该实用程序足以为您创建一个良好的加载文件,并对其进行读写测试。 尽管有很多方法可以自定义您的测试,但是我建议您从一个简单而可靠的结果开始。

Mentioned below is the test arguments I used. I will explain each argument I used.

下面提到的是我使用的测试参数。 我将解释我使用的每个参数。

Sample Command Line Argument:

示例命令行参数:

diskspd -b64k –d120 –o32 –t4 –h –r –w25 –L –c2G D:\TestLoad\TestLoad.dat > diskspd_resultdetails.txt

diskspd -b64k –d120 –o32 –t4 –h –r –w25 –L –c2G D:\ TestLoad \ TestLoad.dat> diskspd_resultdetails.txt

  • -b64k: This indicates that a 64KB block size will be used for the load. This is good because ideally speaking your drives should be formatted by 64K block size. Though you can increase or decrease it based on your custom built environment. -b64k:这表明将使用64KB的块大小进行加载。 这很好,因为理想情况下,您的驱动器应采用64K块大小进行格式化。 尽管您可以根据自定义构建的环境来增加或减少它。
  • -d120: This means that the duration of the test will be 120 seconds. You can span it to more time if you want to test the disk with larger and longer loads. Which is a good idea. -d120:这意味着测试的持续时间将为120秒。 如果要使用更大和更长的负载测试磁盘,则可以将其花费更多时间。 这是个好主意。
  • -o32: This is the number of outstanding I/O operations which is like your queue length. -o32:这是未完成的I / O操作的数量,类似于您的队列长度。
  • -t4: This means that each file will have 4 threads attached to it. I have 4 core processor so I added 4 and you can customize it to match your server specifications. -t4:这意味着每个文件将具有4个附加线程。 我有4个核心处理器,因此我添加了4个,您可以对其进行自定义以匹配您的服务器规格。
  • -h: This will disable the software and hardware buffering to mimic SQL Server. -h:这将禁用软件和硬件缓冲来模仿SQL Server。
  • -r: The utility can perform sequential reads (default) or random read. I would prefer to use random reads. The r argument is to specifically ask utility to do only random reads. -r:该实用程序可以执行顺序读取(默认)或随机读取。 我宁愿使用随机读取。 r参数是专门要求实用程序仅进行随机读取。
  • -w25: The utility can do reads and writes test and by default it only does the read. But we want read and writes both. It’s a good idea to split a SQL Server load to 25% Writing and 75% reading. Though you can test your disk as per your requirements like for log files you should only specify –w100 to only test writing. -w25:该实用程序可以读取和写入测试,并且默认情况下它仅读取。 但是我们要同时读写。 将SQL Server的负载分成25%写入和75%读取是一个好主意。 尽管您可以按照日志文件等要求来测试磁盘,但仅应指定–w100以仅测试写入。
  • -c2G: This will create a test load file of 2 GB on the specified location. -c2G:这将在指定位置创建2 GB的测试加载文件。
  • > “diskspd_resultdetails.txt”: This is the filename of the results. The file will be created in the C Drive where you will place the diskspd.exe file, in this case, “C:\diskspd_test”. >“ diskspd_resultdetails.txt”:这是结果的文件名。 该文件将在C驱动器中创建,您将在其中放置diskspd.exe文件,在本例中为“ C:\ diskspd_test”。

Well the test will run for 2 minutes in this case and it will do the specified work you mentioned in the arguments. After the test has been run completely it will generate the results file and then you will read and analyze the file.

那么在这种情况下,测试将运行2分钟,它将完成您在参数中提到的指定工作。 完全运行测试后,它将生成结果文件,然后您将读取并分析该文件。

让我们继续阅读我的结果 (Let’s go ahead and read what my results are)

The first part of the results which is shown below tells us what arguments and settings the utility will use to test the load. So, all the arguments explained earlier are mentioned in further details by the utility itself.

结果的第一部分如下所示,它告诉我们实用程序将用来测试负载的参数和设置。 因此,实用程序本身会进一步详细介绍前面解释的所有参数。

中央处理器 (The CPU)

The second part of the results shows how the CPU behaved while the load was executed. All the results will have two parts, first will be detailed for each resource and the last will be average or total. So we can quickly go to the last part just to see how was the average CPU while the load was executed to see if we have CPU bottleneck or its perfectly suits our load.

结果的第二部分显示了执行加载时CPU的行为。 所有结果将分为两部分,第一部分将详细说明每种资源,最后一部分是平均值或总计。 因此,我们可以快速转到最后一部分,只是看看执行负载时的平均CPU状况如何,看看我们是否有CPU瓶颈或它完全适合我们的负载。

磁盘 (The Disk)

The third part is the core of all the utility, the disk! This again has different parts in the results.

第三部分是磁盘的所有实用程序的核心! 这在结果中又有不同的部分。

First part shows the Total IO as a Summary to see how well the disk responded. You can see the “AvgLat” column to see the Average Latency of the disk for total IO. Not to go into the details of the latency but generally speaking it should remain under 20ms. If it goes beyond then you have serious issues with your server. (I know my system sucks but the drive is an OLD SATA III).

第一部分以汇总形式显示总IO,以查看磁盘的响应情况。 您可以查看“ AvgLat”列,以查看磁盘的平均IO延迟。 不赘述延迟的细节,但是通常来说,它应该保持在20ms以下。 如果超出此范围,则说明您的服务器存在严重问题。 (我知道我的系统很烂,但是驱动器是OLD SATA III)。

The I/Os can on the lower side as the load is divided on worker threads so you can directly go to the TOTAL column highlighted in the below screenshot which will show you the total load (in 64k block size in our case).

由于负载是在工作线程上分配的,因此I / O可以位于下方,因此您可以直接转到下面的屏幕快照中突出显示的TOTAL列,该列将向您显示总负载(本例中为64k块大小)。

The Second part shows Reads and third part shows Writes. This is most important part of the results. You can go into the details of every column but the Latency should be kept in mind as this is the main reason for slowness when the actual load will be executed by the users. This clearly shows how well your disk is performing under your load for reads and writes.

第二部分显示读取,第三部分显示写入。 这是结果中最重要的部分。 您可以进入每一列的详细信息,但应牢记等待时间,因为这是用户执行实际加载时速度缓慢的主要原因。 这清楚地显示了磁盘在负载下的读写性能。

The last part of the results is dedicated to the latency and shows how well the disk performed while the load was executed. This numbers are in milliseconds and you can focus on minimum and maximum. So keep in mind that the best case scenario will be minimum and the worst case scenario will be max and that will be the time when your server will be in peak hours.

结果的最后一部分专用于等待时间,并显示磁盘在执行加载时的性能。 此数字以毫秒为单位,您可以专注于最小值和最大值。 因此请记住,最好的情况是最小,最坏的情况是最大,这就是服务器处于高峰时段的时间。

Now, after having the knowledge of this awesome utility, you can design multiple test load for different environment and run them so see how storage system and CPU is performing. The detailed tests can give your insight and you can modify the load of upgrade your resources accordingly to your needs.

现在,在了解了该实用工具之后,您可以针对不同的环境设计多个测试负载并运行它们,从而了解存储系统和CPU的性能。 详细的测试可以提供您的见解,并且您可以根据需要修改资源升级的负担。

翻译自: https://www.sqlshack.com/sql-server-performance-measure-disk-response-time/

sql数据库磁盘响应时间长

sql数据库磁盘响应时间长_SQL Server性能–测量磁盘响应时间相关推荐

  1. sql server 性能_SQL Server性能基础

    sql server 性能 "The goal of monitoring databases is to assess how a server is performing. Effect ...

  2. sql server 性能_SQL Server性能神话破灭

    sql server 性能 介绍 (Introduction) In this article, we will verify if the following statements are true ...

  3. semaphore性能问题_SQL Server性能调整– RESOURCE_SEMAPHORE等待

    semaphore性能问题 When dealing with SQL Server performance tuning waits, we may see RESOURCE_SEMAPHORE w ...

  4. sql数据库自动增量备份_SQL自动增量

    sql数据库自动增量备份 Sometimes we don't have unique identifiers in the table to create a primary key. In thi ...

  5. mysql数据库sa默认密码_SQL Server数据库sa密码相关问题的解决方法

    1.如何查找sqlserver的sa密码? 查询分析器,连接时,身份验证使用"使用windows身份验证" 然后,执行: EXEC sp_password NULL, 'NewPa ...

  6. 云原生 SQL 数据库 CockroachDB 2.0 发布:性能极大提升

    2018 年 4 月,CockroachDB 2.0 版本正式发布,带来全新升级.作为 CockroachDB 2.x 系列的第一个版本,CockroachDB 2.0 极大提升了性能,并带来了一系列 ...

  7. server sql 数据库列名price无效_SQL学习笔记整理(持更)

    从零开始学习SQL,在这里分享自己的笔记,主要通过自己看的.做的例题映射知识点.入门级SQL 应知应会Key Point与例题.虽然这个笔记不是最全面深入的,但一定必含小白入门必懂基础要点(非常基础) ...

  8. 数据库startup报错_SQL Server数据库恢复过程内部–数据库STARTUP命令

    数据库startup报错 A database recovery process is an essential requirement for database systems, It can be ...

  9. sql子句的执行顺序_SQL Server查询执行计划– WHERE子句的示例

    sql子句的执行顺序 previous part of this article, we explained how indexes affect SQL Server query execution ...

最新文章

  1. http://blog.csdn.net/luoshengyang/article/details/6651971
  2. Java黑皮书课后题第3章:3.2(游戏:将三个数相加)程序清单3-1中的程序产生2个整数并提示用户输入这两个整数的和。修改该程序使之能产生三个个位数整数,提示用户输入这三个整数的和
  3. 深度学习网络模型AlexNet
  4. S5PV210裸机之SDRAM
  5. 从阿里、微软、AWS财报看评云计算发展
  6. 4-3-串的块链存储结构-串-第4章-《数据结构》课本源码-严蔚敏吴伟民版
  7. python排序-堆排序
  8. eclipse class 中无法打断点
  9. 十大经典算法_家庭用电预测:线性回归算法(时间与功率功率与电流之间的关系)
  10. 基于python的opc读写和导入MSSQL/MYSQL的KepOPC中间件
  11. Java设计模式补充:回调模式、事件监听器模式、观察者模式(转)
  12. 教你如何选型到合适的OA系统
  13. CSGO显示FPS(帧数)指令集设置调用方法 2020年最新版本CSGO教程
  14. presenting view controller Vs presented view controller
  15. html css 微信小程序,tailwindcss 支持微信小程序配置
  16. 计算机PPT中项目编号怎么弄,电脑技巧收藏家电脑基础设置幻灯片格式:项目符号和编号...
  17. 计算机桌面网络连接,我电脑开机进入桌面后要等近5分钟右下角才会出现网络连接图标,进而才能上网,为什么?...
  18. JMeter元件详解之配置元件
  19. Gearbox变速器
  20. 浙江大华嵌入式软件工程师笔试题

热门文章

  1. python几个面试题整理
  2. codevs 5958 无
  3. [Java][Servlet] Failed to destroy end point associated with ProtocolHandler [http-nio-8080]
  4. lua本学习笔记功能
  5. [Android]Handler的消息机制
  6. 【转载】一步步构建大型网站架构
  7. 判别模型和生成模型(Discriminative Model Generative Model)【转】
  8. 存储过程中while循环
  9. django 中的用户身份验证和 session 的关系
  10. export ‘Switch‘ (imported as ‘Switch‘) was not found in ‘react-router-dom‘