Heroku:网络动态与工人动态?我需要多少/什么比例? [英] Heroku: web dyno vs. worker dyno? How many/what ratio do I need?

查看:103
本文介绍了Heroku:网络动态与工人动态?我需要多少/什么比例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇网络和工作人员dynos在Heroku上的区别。他们在定价页面上给出了一个单句解释,但这只是让我感到困惑。我怎么知道每个人挑选多少?我应该瞄准一个比例吗?我对这个东西很新,所以有人可以给出一个深入的解释,或者某种方式,我可以计算出我需要多少和哪种类型的dynos?



另外,我对每个dyno的小时数是什么意思感到困惑。 http://www.heroku.com/pricing



我也发生过这篇文章。作为他们建议的解决方案之一,他们表示要增加dynos的数量。他们指的是哪种类型的测功机?

http://devcenter.heroku.com/articles/backlog-too-deep

解决方案

如果您需要更多dynos(又名Cedar上的进程),那么您的最佳指标就是您的heroku日志。请确保您升级到扩展日志记录(它是免费的),以便您可以记录日志。



您正在寻找heroku.router条目和您最感兴趣的值是队列值 - 如果这个值始终大于0,那么这是一个很好的迹象,你需要添加更多的dynos。基本上这意味着比进程可以处理更多的请求,因此他们正在排队。如果他们排队太久而没有返回任何数据,他们将被超时。



恐怕没有理想的比例,您可以让应用每秒处理100个请求需要很多网络进程,但不会使用工人。如果您在后台进行处理,比如发送电子邮件等,只需要工作进程。



ps积压太深将导致Dyno web进程。 / p>

更新:2013年3月26日Heroku从注销中删除队列和等待字段。


$ b


队列和等待字段已从路由器日志消息中删除。
此外,Heroku路由器不再为
设置X-Heroku-Dynos-In-Use,
X-Heroku-Queue-Depth和X-Heroku-Queue-Wait-Time HTTP头传入的请求。



I was curious as to what the difference between web and worker dynos is on Heroku. They give a one sentence explanation on their pricing page, but this just left me confused. How do I know how many to pick of each? Is there a ratio I should aim for? I'm pretty new to this stuff, so can someone give an in depth explanation, or maybe some sort of way I can calculate how many and which kind of dynos I would need?

Also, I'm confused about what they mean by the amount of hours for each dyno.

http://www.heroku.com/pricing

I also happened upon this article. As one of their suggested solutions, they said to increase the amount of dynos. Which type of dyno are they referring to here?

http://devcenter.heroku.com/articles/backlog-too-deep

解决方案

Your best indication if you need more dynos (aka processes on Cedar) is your heroku logs. Make sure you upgrade to expanded logging (it's free) so that you can tail your log.

You are looking for the heroku.router entries and the value you are most interested is the queue value - if this is constantly more than 0 then it's a good sign you need to add more dynos. Essentially this means than there are more requests coming in than your process can handle so they are being queued. If they are queued too long without returning any data they will be timed out.

There's no ideal ratio I'm afraid, you could have an app doing 100 requests a second needing many web processes but just doesn't make use of workers. You only need worker processes if you are doing processing in the background like sending emails etc etc.

ps Backlog too deep would be a Dyno web process that would cause it.

UPDATE: On March 26 2013 Heroku removed queue and wait fields from the log out put.

queue and wait fields have been removed from router log messages. Also, the Heroku router no longer sets X-Heroku-Dynos-In-Use, X-Heroku-Queue-Depth and X-Heroku-Queue-Wait-Time HTTP headers for incoming requests.

这篇关于Heroku:网络动态与工人动态?我需要多少/什么比例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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