ruby puma.rb
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby puma.rb相关的知识,希望对你有一定的参考价值。
before_fork do
require 'puma_worker_killer'
PumaWorkerKiller.config do |config|
config.ram = 1024 # mb
config.frequency = 5 # seconds
config.percent_usage = 0.98
config.rolling_restart_frequency = 12 * 3600 # 12 hours in seconds
config.reaper_status_logs = true # setting this to false will not log lines like:
# PumaWorkerKiller: Consuming 54.34765625 mb with master and 2 workers.
config.pre_term = -> (worker) { puts "Worker #{worker.inspect} being killed" }
end
PumaWorkerKiller.start
end
以上是关于ruby puma.rb的主要内容,如果未能解决你的问题,请参考以下文章
地址已用于 puma-dev
如何让 puma 将日志发送到标准输出
Puma 未定义的局部变量或方法“守护进程”错误
将 Rails + Puma + Postgres 应用程序部署到 Elastic beanstalk 的正确方法?
Heroku:Rails 5 WebSocket 连接失败
rails部署成功,但Elastic Beanstalk返回522