1
如果我在Heroku配置中設置了WEB_CONCURRENCY = 3,爲什麼我會有4個Puma工人?設置Heroku上的Puma工人數量
在this question中,我瞭解到New Relic稱Puma worker爲「app instances」。
這裏是我的puma.rb
配置:
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 1)
threads threads_count, threads_count
preload_app!
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
on_worker_boot do
# Valid on Rails 4.1+ using the `config/database.yml` method of setting `pool` size
ActiveRecord::Base.establish_connection
end
Heroku的配置:
WEB_CONCURRENCY: 3
謝謝。主進程是否像工人一樣使用內存? – user1515295