对于任何 Win OS 上的大多数多线程应用程序,CPU 最大利用率限制为 1/N 个 CPU:为什么?

托尼·斯图尔特 Sunnyskyguy EE75

我在某种程度上了解多线程和任务处理,但知道在操作系统之外,大多数 Windows 应用程序仅限于使用 1/N CPU 的平均最大值。利用率。

这是双核的 50%,4 个 CPU 的 25% 和所有 8 个 CPU 的 12.5%。如果使用 Procexp.exe 取消分配 CPU 或选择偶数或奇数 CPU,这不会更改结果。

我的问题

有什么方法可以增加超出此操作系统限制的利用率。我理解如果一个应用程序 100% 强加给一个应用程序。操作系统可能会在预期或要求的超时时间内因无响应的硬件 I/O 出现蓝屏,但即使是 50% 或 75% 也会改善我的结果。

然而,在执行大型任务时,操作系统中的 explorer.exe 等有时可以达到 50% 或更多(?)。

  • 通常情况下,CPU 处于 98~99.5% 空闲状态,只需打开浏览器和 10 个选项卡(勇敢)

我在 LibreOffice SCALC.exe 上使用 Win7 i7-4770S Haswell 3.1GHz 和 16GB RAM 以及一个包含 150 万个 CV19 美国数据单元格的电子表格,并进行了搜索/替换 ' 文本前缀以尝试将文本转换为每天的单元格编号日期(有一些从文本到值的选项)并且它仍在运行(是的)并且很明显我使用了错误的方法。

如果无法更改操作系统利用率,那么我是否应该重写这个问题,将 400 个文本条目转换为日期 '1\20\2020 的值,以重新格式化为我喜欢的值。

  • 该文本文件是从 JHU CV19 美国县每日死亡率累计总数的 GitHub 存储库下载的,并使用文本到列的转换导入 SCALC。

SCALC还在运行!” ,根据使用 11 个线程的 PERFMON,为 12.5%。

问题始于在 150 万个单元格电子表格中搜索和替换 1 个字符。我选择了“similarity-option”,这是一个错误,但问题不是 Excel 或 Open Office Apps,许多应用程序是多线程的,但平均限制为 1/N 个 CPU,无法更改我可以用图像证明这一点,但你们中的一些人会知道这是真的。

其他人不明白这个问题。是的,可以编写或为 Windows 执行此操作,但不能使用罐装应用程序。

示例 1 一个大文件进程的简单启动恢复只需要几秒钟,并且达到 20% 以上的峰值。它可以在一秒钟内达到超过平均 12.5% 的峰值,但在内存吞吐量限制时我认为不会持续。(所以我想没有什么可以改善这一点?)

在此处输入图片说明

在这里搜索在 150 万个单元格上用 0 替换 0 在我捕获屏幕截图之前平均正好是 12.5%。

在此处输入图片说明

这里几乎完全是 1/N 或所有 CPU 工作负载的 12.5% 专用于具有多个线程的 1 个应用程序。

我可以使用这种架构在 Windows 下的许多其他应用程序上复制这个测试。那么它是架构 - 内存缓存总线有限和任何修复?

正如其他人在此论坛上所写,1/N CPU 的限制或 12.50 %

这就是证据。

在此处输入图片说明

More proof on multi-thread MS App i=only using 1/N CPU % average MAX

在此处输入图片说明

Update

Installed WordPerfect 2020 with QUattro Pro and ran the exact same multi-threaded process and got exactly THE SAME RESULT MAX CPU USE on all 8 CPUs = 1/8 = 12.5% 在此处输入图片说明

Example #4

  • of a multi-threaded process again utilized all CPu's but in total only 1/N CPUs or 12.5% is Mark Russinovich's Process Explorer ,aka PROCMON.exe. which was independent of all other processes using few resources.

I doubt it was Mark's ability to program multi-threading here. :) (MS Fellow)

在此处输入图片说明 在此处输入图片说明

My CPU Latency is on top 在此处输入图片说明

Mokubai

Not all tasks are inherently capable of being split into a task that is able to simultaneously run on every core of the CPU.

Each core in your CPU is a fully fledged processor. It is able to maintain information on the execution state of one hardware "thread". Each core has its own cache and data handling independent of every other core. They might share a cache and memory bus, but they are otherwise completely separate.

That thread translates roughly to what is known in software as a thread.

The problem you are seeing is that the particular task doing the work within that software is inherently single threaded.

A single thread is only capable of executing on one core at a time. On an 8 core processor that means that a single thread can use at most 1/8th of your processor, or 12.5% according to task manager. On a 4 core processor that is 1/4 or 25%.

A program can have many threads, but those threads can only work on things that are completely unrelated to each other. One thread might be handling updating data being the scenes, another might be updating the GUI and so on.

What threads cannot do is work on the exact same data at the same time without communicating with each other and it is that limit you are seeing.

In order to use more than one CPU core the task being done has to be split up and parcelled out to multiple threads. That splitting up is a programming problem and is down to the software engineers to implement. Whether or not any given task is multithreaded is down to the complexity of that task and whether it can be split up in the first place

  • does the task contain data that can be split out into independent data sets in order to be worked on by separate threads?
  • 该软件是否已编写为将该特定任务拆分为单独的线程?

如果数据完全依赖于以特定方式处理,那么它永远不会使用多个核心。

如果数据可以拆分但需要更多的工作来拆分和重新合并,那么软件工程师可能会认为不值得付出努力,而是坚持使用一个线程/核心。

如果数据可以拆分并且软件设计为这样做,那么您将看到超过 1 个正在使用的内核。

我知道 Excel 支持多核计算的许多任务,但它完全依赖于彼此绝对没有依赖关系的数据。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

为什么实际的CPU利用率百分比超过Kubernetes中的Pod CPU限制

为什么大多数应用程序协议都分配了两个端口?

设置Linux中CPU核心利用率的限制

为什么我的应用程序抽屉中显示了两个大多数默认应用程序?

为什么对于没有多线程的Java程序,gtime命令返回的CPU使用率> 100%?

确定CPU利用率

计算CPU利用率

为什么我的 CPU 在 4 个内核中的 1 个上达到最大值?

为什么单线程应用程序占用多核并限制cpu使用率

为什么spark-sql cpu利用率比hive高?

为什么在Prometheus中使用irate或rate计算CPU利用率?

CPU利用率高的原因是什么?

为什么即使我的程序没有创建任何新对象,堆利用率也会随着时间的推移而增加?

计算LPAR CPU利用率(AIX)

确定CPU利用率的时间

GCP上f1-micro的CPU利用率是多少?

当一个线程占用100%的CPU时,多线程应用程序挂起

CPU使用率及其利用率

为什么我的 CPU 利用率在硬件监视器和任务管理器中不同?

调试Java应用程序会导致cpu利用率高

如何确定应用程序内的gc-cpu利用率?

Alfresco 5.2高CPU利用率和应用程序性能降低

任务管理器显示100%的CPU利用率,但是进程列表中没有任何内容

为什么将GC限制为1个线程会提高性能?

单线程CPU上的多线程应用程序?

为什么即使我的应用程序(利用CPU资源的资源)滞后,我的CPU也不能发挥最大的潜力呢?

如何在多线程应用程序中达到100%的CPU使用率?

如何提高Xen来宾CPU利用率?

通过 /proc/stat 当前 CPU 核心利用率