简体   繁体   English

为什么 Java CPU 使用率与 Windows 资源监视器 CPU 使用率不同?

[英]Why is the Java CPU usage different from the Windows Resource Monitor CPU usage?

We are troubleshooting a performance of a Java application.我们正在对 Java 应用程序的性能进行故障排除。 And recently we have been using Application Performance Diagnostics tool for the application.最近我们一直在为应用程序使用应用程序性能诊断工具。 Which also measures the CPU and Memory (don't know the exact method for it but contact the supplier about it).它还测量 CPU 和 Memory(不知道具体方法,但请联系供应商)。 Besides that we have seen the Windows process/resource monitor with CPU usages.除此之外,我们还看到了带有 CPU 使用率的 Windows 进程/资源监视器。 Those are quite different and we don't have any clue.这些完全不同,我们没有任何线索。

The Java application (openjdk8) running on a Windows server 2012 machine.在 Windows 服务器 2012 机器上运行的 Java 应用程序 (openjdk8)。 When we measure the CPU from the Java App we see peaks from 100% till 500% all the time.当我们从 Java 应用程序测量 CPU 时,我们始终看到从 100% 到 500% 的峰值。 While our Virtual Machine/Server has 12 CPU's and Windows resource monitor indicates all the time CPU usage of below 10-15%.虽然我们的虚拟机/服务器有 12 个 CPU,Windows 资源监视器显示 CPU 使用率始终低于 10-15%。 I have few questions regarding this unclarity;我对这种不确定性几乎没有疑问;

1 - Why is there a difference between the CPU measurement between the application and Windows Resource Monitor? 1 - 为什么应用程序和 Windows 资源监视器之间的 CPU 测量存在差异? 2 - How is it possible that it can burst 500%? 2 - 怎么可能爆500%? 3 - Where can I adjust on Windows OS normally the application allocated CPU so that it has that 500% directly available as CPU resource 3 - 我在哪里可以在 Windows 操作系统上正常调整应用程序分配的 CPU,以便它有 500% 可直接用作 CPU 资源

One difference between the two tools seems to be what is 100%:这两种工具之间的一个区别似乎是什么是 100%:

  • your tool measures 1 core full busy = 100%, 5 cores full busy = 500%您的工具测量 1 个核心全忙 = 100%,5 个核心全忙 = 500%
  • the Windows resource monitor measures 12 cores full busy = 100%, 1 core full busy = 8%, 2 cores full busy = 16% Windows 资源监视器测量 12 个核心全忙 = 100%,1 个核心全忙 = 8%,2 个核心全忙 = 16%

The other difference might be sampling / averaging period:另一个区别可能是采样/平均周期:

  • your tool might measure peak usage: 5 cores full busy at least once during the sampling period您的工具可能会测量峰值使用率:在采样期间至少有一次 5 个核心全忙
  • the Windows resource monitor measures average usage: 5 cores busy during 40% of the sample time, all cores idle during the remaining time give an average of 16% usage of the full available capacity Windows 资源监视器测量平均使用率:5 个内核在 40% 的采样时间内忙碌,所有内核在剩余时间内空闲,平均使用全部可用容量的 16%

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM