Ruby on rails 为什么htop显示的线程比puma配置多?
我的puma配置:Ruby on rails 为什么htop显示的线程比puma配置多?,ruby-on-rails,puma,Ruby On Rails,Puma,我的puma配置: #!/usr/bin/env puma workers ENV.fetch("WEB_CONCURRENCY") { 2 } threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } threads threads_count, threads_count worker_timeout 30 preload_app! port ENV['PORT'] || 80 environment ENV['RAILS_ENV'] |
#!/usr/bin/env puma
workers ENV.fetch("WEB_CONCURRENCY") { 2 }
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count
worker_timeout 30
preload_app!
port ENV['PORT'] || 80
environment ENV['RAILS_ENV'] || 'development'
rackup DefaultRackup
before_fork do
ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
end
on_worker_boot do
ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
end
htop:
线程数应为5,但htop显示每个辅助进程(进程)中有12个线程。顺便说一句,我在docker容器中运行workers和htop
这让我很困惑,有人能解释一下吗 您可以阅读更多关于puma的信息-puma可以为内部目的创建线程。