本文介绍了同一个dyno可以运行多个进程吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建运行多个微服务的小型应用程序.我想这个应用程序全天候24/7可用,所以免费的dyno小时对我来说还不够.如果我升级到 hobby 计划,我会得到 10种流程类型.

I am creating small app running multiple microservices. I would like to have this app available 24/7, so free dyno hours are not enough for me. If I upgrade to a hobby plan I would get 10 Process Types.

我可以在每个进程(Web)上运行另一种微服务,还是Heroku只能让每个dyno安装一个Web进程,而其他 10种进程类型是用于扩展我的能力应用程序?换句话说,如果我需要运行24/7的6个微服务,我应该购买6个爱好测功机吗?

Can I run another microservice on each of the processes (web), or does Heroku give me the ability only to install one web process per dyno, and the other 10 process types are for scaling my app? In other words, If i need 6 microservices running 24/7 should I buy 6 hobby dynos?

推荐答案

您只能使用1种Web进程类型.您可以水平缩放Web进程以在多个dyno上运行(水平可伸缩性"),但是您需要至少升级到标准的1x dyno类型才能做到这一点(即,如果您正在使用,则只能运行1个Web dyno实例.免费或爱好测功类型).

You can only have 1 web process type. You can horizontally scale your web process to run on multiple dynos ("horizontal scalability"), however you will need to upgrade to at least standard-1x dyno types to do that (i.e. you can only run 1 web dyno instance if you are using free or hobby dyno types).

但是,除了您的Web流程之外,您还可以实例化其他多种流程类型(例如工人"流程).这些将无法侦听来自客户端的HTTP/S请求,但可用于从Web进程中卸载长期运行的作业.

However, in addition to your web process, you can instantiate multiple additional process types (e.g. "worker" processes). These will NOT be able to listen on HTTP/S requests from your clients, but can be used for offloading long-running jobs from your web process.

因此,如果您将4-6个微服务中的每个微服务映射到Procfile中的不同进程类型,并且如果微服务本身不是Web服务器,则可以使用业余测功机.

So, if you map each of your 4-6 microservices to a different Process Type in your Procfile, and if your microservices are not themselves web servers, you might be able to make do with hobby dynos.

这篇关于同一个dyno可以运行多个进程吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-18 13:29