use*_*092 10 heroku unicorn heroku-postgres
偶尔,每当我收到以下错误(我正在运行2 512MB dynos)后不久我将一个版本推送到Heroku:
2014-11-21 00:38:30.216
188 <45>1 2014-11-21T00:38:29.163459+00:00 heroku web.2 - - Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
Run Code Online (Sandbox Code Playgroud)
我正在使用独角兽应用程序服务器,不幸的是每个512MB dyno只有1个独角兽工作者(因为在它的高峰期,我的应用程序RSS是320MB - 是的,去看看,有些臃肿正在发生).不确定这是否有帮助,但我在启用预启动的Cedar14上.UNICORN_WORKERS设置为1.
这是我的独角兽设置.我应该关注这个错误吗?
虽然我们讨论这个话题,但是我的2个dynos的db pool size 15太大了(我使用Postgres标准,允许多达120个并发连接).
worker_processes Integer(ENV['UNICORN_WORKERS'] || 2)
timeout Integer(ENV['UNICORN_TIMEOUT'] || 25)
preload_app true
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end
if defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.disconnect!
end
end
after_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
end
# other settings
if defined?(ActiveRecord::Base)
config = ActiveRecord::Base.configurations[Rails.env] || Rails.application.config.database_configuration[Rails.env]
config['reaping_frequency'] = Integer(ENV['DB_REAPING_FREQUENCY'] || 10)
config['pool'] = ENV['DB_POOL'] || 15
ActiveRecord::Base.establish_connection(config)
end
end
Run Code Online (Sandbox Code Playgroud)
rde*_*ges 10
Heroku在部署时有规则基本上说:
这样做是为了确保您没有运行大量账单,因为您的某个进程在某种程度上从未退出.
在你的情况下发生的事情(我在这里推测),是你有很多开放的数据库连接,并且关闭它们需要10秒以上,因为:
总的来说,这不是什么大不了的事.随着时间的推移,这个问题会自行解决,所以我不担心.
| 归档时间: |
|
| 查看次数: |
3634 次 |
| 最近记录: |