Heroku应用程序可以向/从本身添加/删除dynos还是工作人员? [英] Can a Heroku app add/remove dynos or workers to/from itself?

查看:141
本文介绍了Heroku应用程序可以向/从本身添加/删除dynos还是工作人员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Heroku允许您即时添加和删除dynos和工作人员,并且每次使用它们每秒收取费用。可以设置我的应用程序,以便它可以根据它的负载来添加/删除dynos和worker?

Heroku allows you to add and remove dynos and workers on the fly and charges you per second that each is used. Is it possible to set up my app so that it can add/remove dynos and workers from itself depending on the load it's under?

Heroku.com上的这一段提到一个API,但是不了解更多。

This paragraph on Heroku.com mentions an API, but I can't find out much more about it.

推荐答案

是的。你想要的是这样的:

Yes. What you want is something like this:

require 'heroku'
Heroku::Client.new("username", "password").set_workers("appname", num_workers)

这篇关于Heroku应用程序可以向/从本身添加/删除dynos还是工作人员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆