简体   繁体   English

如何通过长初始化将Azure Cloud Service明智地转换为Azure Service Fabric服务?

[英]How would I sensibly convert an Azure Cloud Service with long initialization into an Azure Service Fabric service?

Currently we run resource intensive processing as a Cloud Service with a web role. 目前,我们将资源密集型处理作为具有Web角色的Cloud Service运行。 The service package only contains frequently changing .NET assemblies. 服务包仅包含经常更改的.NET程序集。 There's also a dependency onto a C++ DCOM server which is about one gigabytes of code and data total. 还有一个对C ++ DCOM服务器的依赖,它大约有一千兆字节的代码和数据。 That DCOM server is packed into an archive and put into blob storage. DCOM服务器被打包到一个存档中并放入blob存储中。 When a role instance starts its OnStart() downloads the archive, unpacks it into local filesystem and registers the DCOM server, the .NET code then consumes the DCOM server. 当角色实例启动时, OnStart()下载存档,将其解压缩到本地文件系统并注册DCOM服务器,然后.NET代码将使用DCOM服务器。

It works but scaling is quite slow - it takes about two-five minutes between a scale-out operation is sent to Azure Management Service and role OnStart() runs (and then it takes about one more minute to run OnStart() ). 它可以工作,但扩展速度非常慢 - 在向外扩展操作发送到Azure管理服务和角色OnStart()运行之间大约需要两到五分钟(然后运行OnStart()需要大约一分钟)。 I heard that HyperV containers are nearly magic for scaling out - they scale nearly instantly. 我听说HyperV容器几乎可以用于扩展 - 它们几乎可以立即扩展。 I also heard that Azure Service Fabric uses containers to host service instances. 我还听说Azure Service Fabric使用容器来托管服务实例。 So I assume that Azure Service Fabric could be used to resolve our issues with slow scaling. 因此,我假设Azure Service Fabric可用于解决缓慢扩展的问题。

The question is - what can be done to that long running code in OnStart() . 问题是 - 在OnStart()可以对长时间运行的代码做些什么。 Having each service instance run that code kind of defeats containers - they would scale fast, then get stuck with that initialization code. 让每个服务实例运行该代码类型会使容器失败 - 它们会快速扩展,然后陷入初始化代码。

Can Azure Service Fabric do something like dual-phase initialization where something equivalent to OnStart() first runs in a single instance while the service is being deployed and then a fully initialized instance is just "cloned" quickly to scale the service out on demand? Azure Service Fabric可以执行类似双阶段初始化的操作,其中等同于OnStart()东西在部署服务时首先在单个实例中运行,然后快速“克隆”完全初始化的实例以按需扩展服务吗? Can it do anything better for the described scenario? 它可以为描述的场景做更好的事情吗?

在Service Fabric中,依赖关系理想地作为应用程序包的一部分(可选地进行容器化)来承载,这意味着它们在尝试启动实际服务之前将被复制到盒子中 - 此外,应用程序映像已经在Service Fabric集群,这意味着它通常在本地或至少从同一组计算机(而不是从网络或存储帐户所在的任何位置)复制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM