t–sql pl–sql

Starting with this article, we will present the most important CPU metrics, describe the information they show, and give recommended values and thresholds

从本文开始,我们将介绍最重要的CPU指标,描述它们显示的信息,并提供建议的值和阈值

Processor metrics show processor performance and influence of other components on processor

处理器指标显示了处理器性能以及其他组件对处理器的影响

处理器:%处理器时间 (Processor: % Processor Time)

The % Processor Time counter shows the percentage of time that “the processor actually spends working on productive threads and how often it was busy servicing requests.” [1]

处理器时间百分比计数器显示“处理器实际在生产线程上花费的时间以及它忙于处理请求的频率”的时间百分比 [1]

As soon as the computer is turned on, the processor is executing threads with instructions. The processor is always active, even when there are no user or system threads, it is not completely idle as it executes the “idle thread” then

一旦打开计算机,处理器就会执行带有指令的线程。 处理器始终处于活动状态,即使没有用户或系统线程,它也不会完全空闲,因为它会执行“空闲线程”,然后

By design, there can be only one idle thread per processor. It has the lowest priority among all processor threads. The basic priority classes are idle, normal, high, and real. This means that an idle process is running on a processor only when there are no other threads. The idle process isn’t a real process that “eats” processor resources. It only occupies the processor until a real productive thread appears. A high percentage of system idle processes shows that the processor is unused most of the time

按照设计,每个处理器只能有一个空闲线程。 在所有处理器线程中,它的优先级最低。 基本优先级类别是空闲,正常,高和实数。 这意味着仅当没有其他线程时,空闲进程才在处理器上运行。 空闲进程不是真正“消耗”处理器资源的进程。 它只占用处理器,直到出现真正的生产性线程。 高比例的系统空闲进程表明处理器大部分时间都未使用

The percentage of the processor time counter is calculated as the difference between the total processor time and the time the idle thread was running

处理器时间计数器的百分比计算为总处理器时间与空闲线程运行时间之间的差

On a multi-processor machine, an instance of the % Processor Time counter is shown for every processor on the server. On a four-processor machine, the % Processor Time instances will be enumerated 0 to 3. Also, an instance is shown for each processor thread

在多处理器计算机上,将为服务器上的每个处理器显示%Processor Time计数器的实例。 在四处理器计算机上, %Processor Time实例将被枚举0到3。此外,每个处理器线程都显示一个实例。

On a virtual machine, % Processor Time shows the value for the virtual, not the physical machine

在虚拟机上, %Processor Time显示虚拟机(而非物理机)的值

The recommended value for % Processor Time is below 80%. Occasional peaks are acceptable, but it shouldn’t be constantly high. But even high values of the % Processor time counter are not a clear indication of bottlenecks

处理器时间百分比的建议值低于80%。 偶尔的峰值是可以接受的,但不应一直很高。 但是,即使%Processor time计数器的值很高,也不能清楚地表明瓶颈

If the % Processor Time value is constantly high, check the disk and network metrics first. If they are low, the processor might be under stress. To confirm this, check the average and current Processor Queue Length value. If these values are higher than the recommended, it clearly indicates a processor bottleneck. The final solution for this situation is adding more processors, as this will enable more requests to be executed simultaneously. If the Processor Queue Length value is low (the recommendations are given below), consider using more powerful processors

如果“ 处理器时间百分比”值一直很高,请首先检查磁盘和网络指标。 如果它们很低,则处理器可能会承受压力。 要确认这一点,请检查平均和当前的“ 处理器队列长度”值。 如果这些值高于建议的值,则明确表明处理器瓶颈。 针对这种情况的最终解决方案是添加更多处理器,因为这将使更多请求可以同时执行。 如果“ 处理器队列长度”值较低(建议在下面给出),请考虑使用功能更强大的处理器

If the disk and network metrics are elevated, start the analysis and troubleshooting with these metrics first

如果磁盘和网络指标升高,请首先使用这些指标开始分析和故障排除

% Processor Time is also shown in Windows Task Manager, but in case of multiple SQL Server instances running on the same machine, this information is not useful for deeper analysis and troubleshooting, as it doesn’t indicate which instance is presented

Windows任务管理器中也显示了“ 处理器时间百分比” ,但是如果在同一台计算机上运行多个SQL Server实例,则此信息对于进行更深入的分析和故障排除是没有用的,因为它不会指示显示了哪个实例

To be able to troubleshoot the processor issues, it’s necessary to know which processor is under stress and what SQL Server instances have issues. You can achieve this by monitoring additional parameters, such as ProcessID and then find the SQL Server instance that had such ProcessID. Another solution is to use a monitoring tool that shows the processor usage per SQL Server instance out-of-the-box

为了能够解决处理器问题,必须知道哪个处理器承受压力以及哪些SQL Server实例存在问题。 您可以通过监视其他参数(例如ProcessID) ,然后找到具有该ProcessIDSQL Server实例来实现此目的。 另一个解决方案是使用监视工具,该监视工具可以开箱即用地显示每个SQL Server实例的处理器使用情况。

进程:%处理器时间 (Process: % Processor Time)

Windows Performance Monitor offers two counters with similar names Processor: % Processor Time and Process : % Processor Time. It’s important to distinguish between these two metrics and understand the information they show

Windows Performance Monitor提供了两个名称相似的计数器处理器:%Processor TimeProcess:%Processor Time 。 区分这两个指标并了解它们显示的信息很重要

As described above, % Processor Time shows the percentage of time that the processor works on non-idle threads

如上所述, %Processor Time显示处理器在非空闲线程上工作的时间百分比。

The Process: % Processor Time counter splits the processor time percentage per process, so each process is shown as a separate item in the graph. For more useful results, exclude the idle threads and total value

进程:处理器时间百分比计数器按每个进程划分处理器时间百分比,因此每个进程在图中显示为单独的项目。 为了获得更有用的结果,请排除空闲线程和总值

The total value for the processes time can be misleading. If the value is 100%, it can mean that all processes are using an equal share of processor time, or that one is using 90%, while others are struggling. That’s why monitoring the processor time for each process is recommended for troubleshooting

处理时间的总价值可能会产生误导。 如果该值为100%,则可能意味着所有进程都使用相等的处理器时间份额,或者一个进程使用90%的进程,而其他进程却在挣扎。 这就是为什么建议监视每个进程的处理器时间以进行故障排除

处理器队列长度 (Processor Queue Length)

The Processor Queue Length counter shows “a measure of the instantaneous size of the queue for all processors at the moment that the measurement was taken. The resulting value is a measure of how many threads are in the Ready state waiting to be processed.” [1]

处理器队列长度计数器显示“在进行测量时所有处理器的队列瞬时大小的度量。 结果值是多少个线程处于就绪状态等待处理的度量。” [1]

Note that the threads currently running in the processor are not included. Even on a multi-processor machine, there is only one queue for all tasks that are waiting to be processed

请注意,不包括当前在处理器中运行的线程。 即使在多处理器计算机上,对于所有等待处理的任务也只有一个队列

The typical value for this counter is 0 or 1. The recommended value is under 5 per processor. Some DBAs consider the situation to be alarming even when Processor Queue Length is constantly higher than 2. Along with high % Processor Time, a high Processor Queue Length value is a clear indicator of a busy processor

该计数器的典型值为0或1。每个处理器的建议值小于5。 一些DBA认为,即使处理器队列长度始终大于2,这种情况也令人担忧。再加上处理器时间百分比高, 处理器队列长度高就清楚地表明处理器繁忙。

The Processor Queue Length value can be increased due to activity of the applications other than SQL Server, having more than the optimal number of SQL Server instances on a single machine, high number of compilations and recompilations, etc

处理器队列长度值可能会由于除SQL Server之外的其他应用程序的活动,一台计算机上SQL Server实例数量超过最佳数量,大量的编译和重新编译等原因而增加

A high number of processes waiting to be processed and high CPU usage require immediate attention. Start with checking Compilations/sec and Re-Compilations/sec. There is no specific threshold for these metrics – monitor them for a while and set a baseline for typical behavior. A high number of compilations and recompilations usually indicates poor reuse of the query plans. This can be fixed by optimizing your queries and stored procedures

需要立即关注大量等待处理的进程以及较高的CPU使用率。 首先检查“ 每秒编译次数”和“每秒 重新编译次数” 。 这些指标没有特定的阈值–监视一段时间并为典型行为设置基准。 大量的编译和重新编译通常表明查询计划的重用性很差。 可以通过优化查询和存储过程来解决此问题

However, there are some specific actions (such as creating a compressed full database backup) that use a lot of processor resources and cause other tasks to be queued. These actions cause a temporary peak in the Processor Queue Length. Once you identify these actions, these peaks should not be alarming

但是,有一些特定的操作(例如,创建压缩的完整数据库备份)会占用大量处理器资源,并使其他任务排队。 这些操作导致“ 处理器队列长度”中的临时峰值。 一旦确定了这些动作,这些峰值就不会令人震惊

Having applications other than SQL Server on your production server is a common reason for having high values for Processor Queue Length. The simplest way to determine if this is the case is to open Windows Task Manager, sort descending the processes in the Process tab by the CPU usage and monitor the top ones. If SQL Server is not among them, other applications are using more processor time than SQL Server and affecting its performance. The only solution is to remove them or use a dedicated machine for SQL Server only

在生产服务器上使用SQL Server以外的应用程序是“ 处理器队列长度”值较高的常见原因。 确定是否为这种情况的最简单方法是打开Windows任务管理器,按CPU使用率对“进程”选项卡中的进程进行降序排序,并监视最前面的进程。 如果其中不包括SQL Server,则其他应用程序使用的处理器时间比SQL Server多,并影响其性能。 唯一的解决方案是删除它们或仅将专用计算机用于SQL Server

The Processor Queue Length counter shows relevant values when monitoring a SQL Server instance on a virtual machine, so it can be used to indicate insufficient processor resources on the virtual machine and SQL Server instances it hosts

监视虚拟机上SQL Server实例时,“ 处理器队列长度”计数器显示相关值,因此可用于指示虚拟机及其承载SQL Server实例上的处理器资源不足

The % Processor Time and Processor Queue Length counters are among the most important processor performance metrics. They indicate the intensity of processor usage and whether there are more threads to be processed than the processor can handle. If removing other applications that use processor resources and optimizing SQL queries and stored procedures doesn’t solve the processor bottlenecks indicated by these two counters, consider having more powerful processors, or adding additional ones

处理器时间百分比处理器队列长度计数器是最重要的处理器性能指标。 它们指示处理器使用的强度以及要处理的线程是否超过处理器可以处理的数量。 如果删除其他使用处理器资源的应用程序并优化SQL查询和存储过程不能解决这两个计数器指示的处理器瓶颈,请考虑使用功能更强大的处理器,或添加其他处理器

翻译自: https://www.sqlshack.com/sql-server-processor-performance-metrics-part-1-important-cpu-metrics/

t–sql pl–sql

t–sql pl–sql_SQL Server处理器性能指标–第1部分–最重要的CPU指标相关推荐

  1. t–sql pl–sql_SQL Server处理器性能指标–第3部分–指示硬件组件问题的指标

    t–sql pl–sql Part 1 and 第1部分和Part 2 of the SQL Server processor performance metrics series, we descr ...

  2. t–sql pl–sql_SQL Server处理器性能指标–第4部分–处理器指标有助于更深入的调查和故障排除

    t–sql pl–sql In the previous part of this series, we presented the processor metrics that indicate h ...

  3. t–sql pl–sql_SQL Server性能疑难解答的DBA指南–第1部分–问题和性能指标

    t–sql pl–sql It doesn't mean that every SQL Server slowdown is a performance problem. Some specific ...

  4. t–sql pl–sql_SQL Server性能疑难解答的DBA指南–第2部分–监视实用程序

    t–sql pl–sql SQL Server探查器 (SQL Server Profiler ) SQL Server Profiler is a monitoring tool that you ...

  5. t–sql pl–sql_SQL Server –在T-SQL中使用最低的度量单位

    t–sql pl–sql A client recently discovered a discrepancy on one of our reports that showed an improve ...

  6. c统计多线程总时间_SQL Server处理器性能指标–第2部分–处理器:%用户时间,处理器:%特权时间,总时间和线程指标

    c统计多线程总时间 In SQL server processor performance metrics – Part 1 – The most important cpu metrics, we ...

  7. t–sql pl–sql_SQL View –完整的介绍和演练

    t–sql pl–sql In relational databases, data is structured using various database objects like tables, ...

  8. t–sql pl–sql_SQL串联正确完成–第1部分–可疑做法

    t–sql pl–sql This article is a part of three articles series to explore SQL Concatenation techniques ...

  9. t–sql pl–sql_SQL日期时间–您应该知道的15个重要功能!

    t–sql pl–sql Hey, folks! Hope you all are doing well. Today, in this article, we will be highlightin ...

最新文章

  1. Spring Cloud(三)服务提供者 Eureka + 服务消费者(rest + Ribbon)
  2. 刚刚,三名中国航天员奔赴太空!其中一位刚参加完博士毕业典礼!
  3. RHEL5.3下搭建SSH
  4. docker 如何加入kubernetes_使用 Kind 在 5 分钟内快速部署一个 Kubernetes 高可用集群...
  5. 【Python】青少年蓝桥杯_每日一题_11.27_电梯用电量
  6. BZOJ 1176: [Balkan2007]Mokia
  7. Android教程之android平台水波效果!提供源码!
  8. 动态规划问题中最长公共子序列---C语言实现
  9. Python3 - 文件处理
  10. 利用MATLAB生成软件二阶低通滤波器(绝对靠谱)
  11. ANSYS下载安装+使用学习过程
  12. 美国纽约大学计算机专业排名,纽约大学计算机工程专业排名第40(2020年USNEWS美国排名)...
  13. 旁门左道:让移动游戏在APP Store下载量暴涨的邪门功夫
  14. 公式不懂也无妨,业务精通才是真正的算法工程师
  15. mysql 处理emij表情_判断是否emij表情
  16. 最值得期待的 5 个新特性解析JavaScript ES2021
  17. 计算机汉字显示原理,计算机汉字显示原理
  18. 星起航:对接达人提高抖音小店的转化率
  19. srt文件解析 c语言,c语言标准库函数srt排序的介绍与使用.docx
  20. 将SDPT3配置到matlab

热门文章

  1. Java 正则提取银行短信内容
  2. hibernate入门实例
  3. 网络编程之 keepalive(zz)
  4. Node.js 安装指南
  5. layoutSubviews 与 drawRect
  6. IOS--UILabel的使用方法详细
  7. WPF 位置转化和动画
  8. JS与PHP向函数传递可变参数的区别
  9. C++---内存泄漏与防范
  10. 判断拐点_一文教你“如何寻找拐点”——拐点判断,简单易懂,建议收藏