单个heroku应用上的多个工作人员/网络进程 [英] multiple worker/web processes on a single heroku app
问题描述
例如:
worker:节点capture.js
worker:节点process.js
worker:节点purge.js
web:节点api.js
web:节点web。 js
所有进程都必须具有唯一名称。 此外,名称唯一的如Heroku文档中所述, web
和 worker
并不重要,并且没有特殊含义。
过程中包含web
web进程类型是特殊的,因为它是
将从Heroku的路由器接收HTTP通信的唯一进程类型。其他进程类型
可以任意命名。 - ( https://devcenter.heroku.com/articles/procfile )
所以你需要一个 Procfile
像这样:
capture:node capture.js
process:node process.js
purge:node purge.js
api:node api.js
web :node web.js
然后,您可以分别缩放每个进程:
$ heroku ps:scale purge = 4
Is there some way to configure multiple worker and/or web processes to run in the single Heroku app container? Or does this have to be broken up into multiple Heroku apps?
For example:
worker: node capture.js
worker: node process.js
worker: node purge.js
web: node api.js
web: node web.js
All processes must have unique names. Additionally, the names The only process that carries a significant name is the web
and worker
are insignificant and carry no special meaning.web
process, as stated in the Heroku docs:
The web process type is special as it’s the only process type that will receive HTTP traffic from Heroku’s routers. Other process types can be named arbitrarily. -- (https://devcenter.heroku.com/articles/procfile)
So you want a Procfile
like so:
capture: node capture.js
process: node process.js
purge: node purge.js
api: node api.js
web: node web.js
You can then scale each process separately:
$ heroku ps:scale purge=4
这篇关于单个heroku应用上的多个工作人员/网络进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!