0

这是我的场景:我有一个 Windows VM,它上面安装了 2 个运行时(Mule1 和 Mule2)。

现在,如果我必须将 60% 的 VM CPU 分配给 Mule1,将 40% 分配给 Mule2。怎么做到呢?

这甚至可能吗?

4

1 回答 1

0

There is a concept called CPU affinity, when you have more than one core or CPU. The operating system you are using have tools for assigning cores to a process. I'm not aware of a feature to assign or limit a percentage of CPU usage to a process. I don't know about an out of the box feature to limit CPU usage per process.

Linux: You can use the taskset command to set which cores to assign to the mule process.

Example:

taskset -c 0,1 ./mule

Source: https://help.mulesoft.com/s/article/How-to-set-CPU-affinity-for-Mule-ESB-process

Windows: In the Task Manager, you can right-click the java.exe and wrapper-windows-x86-64.exe processes, select "Set Affinity" and choose the processors In this article there are Powershell commands to do the same from the command line: https://help.mulesoft.com/s/article/How-to-set-CPU-affinity-for-a-Mule-ESB-process-in-Windows-as-a-Service

It is completely different topic however Docker allows something similar per container.

于 2020-07-27T13:28:01.643 回答