Azure service fabric “怎么做?”;cpushares“;资源治理政策有效吗?

Azure service fabric “怎么做?”;cpushares“;资源治理政策有效吗?,azure-service-fabric,Azure Service Fabric,将同一容器应用程序的两个版本部署到具有不同“cpuShares”设置(500和1500)的服务结构。我预计,当两个版本都托管在同一个主机上时,版本1将分配三分之一的CPU,然后是第二个,但实际上它们都占用了50%的CPU。 应用程序清单 <ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Appli

将同一容器应用程序的两个版本部署到具有不同“cpuShares”设置(500和1500)的服务结构。我预计,当两个版本都托管在同一个主机上时,版本1将分配三分之一的CPU,然后是第二个,但实际上它们都占用了50%的CPU。

应用程序清单

<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="PI_CalculatorType" ApplicationTypeVersion="770Shares" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Parameters>
    <Parameter Name="PI_Web_Service_InstanceCount" DefaultValue="-1" />
  </Parameters>
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="PI_Web_ServicePkg" ServiceManifestVersion="770Shares" />
    <ConfigOverrides />
    <Policies>
      <ContainerHostPolicies CodePackageRef="Code">
        <PortBinding ContainerPort="80" EndpointRef="PI_Web_ServiceTypeEndpoint" />
      </ContainerHostPolicies>
      <ResourceGovernancePolicy CodePackageRef="Code" MemorySwapInMB="4084" MemoryReservationInMB="1024" CpuShares="770" />
    </Policies>
  </ServiceManifestImport>
  <DefaultServices>
    <Service Name="PI_Web_Service">
      <StatelessService ServiceTypeName="PI_Web_ServiceType" InstanceCount="[PI_Web_Service_InstanceCount]">
        <SingletonPartition />
      </StatelessService>
    </Service>
  </DefaultServices>
</ApplicationManifest>
默认情况下,相对于CPU的一组共享

将此标志设置为大于或小于默认值1024的值 增加或减少容器的重量,并使其能够使用 主机CPU周期的较大或较小比例

您的500设置将导致一个服务使用大约一半的CPU,剩下的留给另一个


将500更改为341应该可以做到这一点。

这是一个已知的容器支持预览位问题。它在即将发布的版本中已修复。

不起作用。我在purpouse上放置了同一应用程序的极限数。一个是770,另一个是220。我希望看到分配的不同CPU周期的时间是原来的3倍,但实际上仍然是50/50。我正在Windows 2016上运行基于artisticcheese/iis:最新imagex2 CPU的进程容器。这是虚拟机。这对你有用吗?或者你是从理论的角度讲的?我似乎遇到了与内存限制相同的问题。。当我检查docker容器时,它甚至看起来好像配置设置得不正确。容器的Hostconfig根本不反映这些值。我认为这是一个bug,因为其余的东西都在正确的位置(如端口映射等)“CpuQuota”:0只要有足够的CPU压力,它在我的环境中就可以正常工作。如果我运行另一个占用CPU的进程,我会看到我的w3wp进程以配置的速率最大化。你解决过这个问题吗?我似乎在内存参数方面遇到了同样的问题。
<ServiceManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="PI_Web_ServicePkg" Version="770Shares" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <ServiceTypes>
    <StatelessServiceType ServiceTypeName="PI_Web_ServiceType" UseImplicitHost="true" />
  </ServiceTypes>
  <CodePackage Name="Code" Version="770Shares">
    <EntryPoint>
      <ContainerHost>
        <ImageName>artisticcheese/iis:latest</ImageName>
      </ContainerHost>
    </EntryPoint>
  </CodePackage>
  <ConfigPackage Name="Config" Version="770Shares" />
  <Resources>
    <Endpoints>
      <Endpoint Name="PI_Web_ServiceTypeEndpoint" Protocol="http" UriScheme="http" />
    </Endpoints>
  </Resources>
</ServiceManifest>
http://192.168.1.193:20001/pi/service.svc/pi/40000