我已阅读了关于Puoku和dyno类型的关于Heroku的所有文章,并且我无法得到直接答案。
我看到一些提及Puma工人的人数应由核心数决定。我找不到任何Heroku显示性能-M或性能-L dyno具有多少个内核的情况。
在本文中,Heroku暗示了一种方法: devcenter.heroku / articles / deployits-rails-applications-with-the-puma-web-server我认为他们建议将线程设置为1并且增加Puma工作者的数量,直到你开始看到R14(内存)错误,然后退出。然后增加线程数量,直到CPU达到最大值,尽管我不认为Heroku会报告CPU利用率。
任何人都可以提供指导吗?
(我也想决定是使用一个性能-L还是多个性能-M dynos,但我认为一旦我找出如何设置工作线程)
解决方案我现在想到的路线图如下所示:
(您想要的dyno的最大线程数类型可以支持)/(基线测试的最大线程可以支持)x(基准测试中的实验PUMA_WORKER的值) - (CPU核心数量)
例如,如果我的 standard-2X dyno中的 PUMA_WORKER 为3基准线,那么 performance-m 上的 PUMA_WORKER 数字将开始测试:
16384/512 * 3 - 4 = 92
您还应该考虑您的应用消耗多少内存,然后选择最低的内存。
编辑:以前我的回答是在 ps:exec 可用之前编写的。您可以阅读官方文档并了解如何使用ssh运行测试程序。它应该比以前更容易。
I've read all of the articles I can find on Heroku about Puma and dyno types and I can't get a straight answer.
I see some mentions that the number of Puma workers should be determined by the number of cores. I can't find anywhere that Heroku reveals how many cores a performance-M or performance-L dyno has.
In this article, Heroku hinted at an approach: devcenter.heroku/articles/deploying-rails-applications-with-the-puma-web-server
I think they're suggesting to set the threads to 1 and increase the number of Puma workers until you start to see R14 (memory) errors, then back off. And then increase the number of threads until the CPU maxes out, although I don't think Heroku reports on CPU utilization.
Can anyone provide guidance?
(I also want to decide whether I should use one performance-L or multiple performance-M dynos, but I think that will be clear once I figure out how to set the workers & threads)
解决方案The roadmap I currently figured out like this:
(Max Threads of your desired dyno type could support) / (Max Threads of baseline dyno could support) x (Your experiment `PUMA_WORKER` value on baseline dyno) - (Number of CPU core)
For example, if the PUMA_WORKER is 3 on my standard-2X dyno as baseline, then the PUMA_WORKER number on performance-m I would start to test it out would be:
16384 / 512 * 3 - 4 = 92
You should also consider how much memory your app consumes and pick the lowest one.
EDIT: Previously my answer was written before ps:exec available. You could read the official document and learn how to ssh into running dyno(s). It should be quite easier than before.
更多推荐
如何确定在Heroku Performance dyno上运行的Puma工人和线程的正确数量?
发布评论