2016-01-01 48 views
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

回答

3

彪马有一个主进程。
它不处理请求。它监视和管理(重启或某事)工作人员。

如果设置3个并发,则有4个进程。 3名工人(管理请求)和1名主进程(管理人员)

+0

谢谢。主进程是否像工人一样使用内存? – user1515295