Azure ApplicationManifest.xml 中的 CpuPercent 是如何工作的?

How does CpuPercent in Azure's ApplicationManifest.xml work?

我目前正在学习如何限制 Azure 服务的 CPU 负载。我基本上制作了一个叉子炸弹,并将限制 CPU 的使用作为我的目标,以便为系统的其余部分留出一部分可用。

我在Resource Governance Policy中找到了"CpuPercent"的值,但是发布到集群后还没看到效果。应用同一行中的内存限制,但 CPU 使用率仍然飙升。我也可以将程序限制为一定数量的内核,但这几乎不是我想要的,因为在正常操作期间这会使处理器的很大一部分空闲。

这是我项目的 ApplicationManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="ForkingCloudType" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Parameters>
    <Parameter Name="Stateful1_MinReplicaSetSize" DefaultValue="3" />
    <Parameter Name="Stateful1_PartitionCount" DefaultValue="1" />
    <Parameter Name="Stateful1_TargetReplicaSetSize" DefaultValue="3" />
  </Parameters>
  <!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion 
       should match the Name and Version attributes of the ServiceManifest element defined in the 
       ServiceManifest.xml file. -->
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="Stateful1Pkg" ServiceManifestVersion="1.0.0" />
    <Policies>
      <!--ServicePackageResourceGovernancePolicy CpuCores="1" /-->
      <ResourceGovernancePolicy CodePackageRef="Code" MemoryInMB="2200" CpuPercent="20" />
    </Policies>
  </ServiceManifestImport>
  <DefaultServices>
    <!-- The section below creates instances of service types, when an instance of this 
         application type is created. You can also create one or more instances of service type using the 
         ServiceFabric PowerShell module.

         The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. -->
    <Service Name="Stateful1">
      <StatefulService ServiceTypeName="Stateful1Type" TargetReplicaSetSize="[Stateful1_TargetReplicaSetSize]" MinReplicaSetSize="[Stateful1_MinReplicaSetSize]">
        <UniformInt64Partition PartitionCount="[Stateful1_PartitionCount]" LowKey="-9223372036854775808" HighKey="9223372036854775807" />
      </StatefulService>
    </Service>
  </DefaultServices>
</ApplicationManifest>

这个 "CpuPercent" 打算如何使用?有文档吗?

在与 Microsoft 技术人员交流后,我得知 CpuPercent 仅在容器内起作用。

但是,我还没有找到或被引导到任何官方文档,所以如果有人能够挖掘出来,那么我会将其作为公认的答案。