We are receiving H12 errors on Heroku. When we investigated the problem, we suspected from one thread to kill the puma process completely and it causes us to get H12 timeout problems.

Our configurations for puma is; MAX_THREADS=60, WEB_CONCURRENCY=1

We are using single Standard-2x dyno for web.

puma.rb

thread_count = ENV.fetch("MAX_THREADS") { 5 }.to_i
threads thread_count, thread_count

port        ENV.fetch("PORT") { 3000 }

environment ENV.fetch("RACK_ENV") { "development" }
workers ENV.fetch("WEB_CONCURRENCY") { 1 }
preload_app!

before_fork do
  ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
end

on_worker_boot do
  ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
end

plugin :tmp_restart

Can it be possible for a thread to kill the puma process completely and cause H12 timeout problems? Thank you for your helps.

0 Answers