gpt4 book ai didi

azure - Azure Service Fabric 无状态服务的配置和资源治理选项?

转载 作者:行者123 更新时间:2023-12-03 01:03:23 24 4
gpt4 key购买 nike

我刚开始使用 Service Fabric,正在尝试确定一些设计选项。我有一个执行不同任务的类库。有些任务是资源密集型且长期运行的(处理来自队列的消息),而另一些任务是短暂的且必须响应(处理来自用户的作业请求)。有大量的缓存数据,因此共享进程是有意义的,并且应用程序是无状态的。我想确保长时间运行的任务不会耗尽其他任务的资源,而且利用率很高。

  1. 是否可以在我的解决方案中创建一个无状态服务项目(引用我的类库)并部署多个共享同一进程的命名 StatelessService 实例,使用配置来区分这些实例执行的任务?有或没有多个 ServiceType(尽管它们似乎是每个项目一个,所以我认为这一定是一种 ServiceType)?

  2. 如果是这样,是否可以对这些服务实例应用不同的资源治理规则,以便为用户驱动的任务保留一些资源?到目前为止,我的印象是,当服务共享进程时,这是不可能的。

最佳答案

  1. 默认shared process model指定这一点:

The preceding section describes the default hosting model provided by Service Fabric, referred to as the Shared Process model. In this model, for a given application, only one copy of a given ServicePackage is activated on a node (which starts all the CodePackages contained in it). All the replicas of all services of a given ServiceType are placed in the CodePackage that registers that ServiceType. In other words, all the replicas of all services on a node of a given ServiceType share the same process.

can specify多种服务类型,多种代码包。

ServiceTypes declares what service types are supported by CodePackages in this manifest. When a service is instantiated against one of these service types, all code packages declared in this manifest are activated by running their entry points. The resulting processes are expected to register the supported service types at run time. Service types are declared at the manifest level and not the code package level. So when there are multiple code packages, they are all activated whenever the system looks for any one of the declared service types.

  • 资源governance在服务 list 中配置,而不是在实例级别配置。
  • 关于azure - Azure Service Fabric 无状态服务的配置和资源治理选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55674943/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com