同一个dyno可以运行多个进程吗?

编程入门 行业动态 更新时间:2024-10-27 00:28:55
本文介绍了同一个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可以运行多个进程吗?

本文发布于:2023-11-22 08:33:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1616705.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   进程   dyno

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!