Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>We've had issues like this with Unicorn for some time . . . we also get seemingly random timeout errors, even though we never see much load and have 4 dynos with 4 workers each (we never have any request queuing). We have had 0 luck getting rid of these errors, even with help from Heroku. I get the feeling even they aren't 100% confident in the optimal settings for Unicorn on Heroku.</p> <p>We just recently switched to Puma and so far so good, much better performance and no weird timeouts yet. One of the other reasons we switched to Puma is that I suspect some of our random timeouts come from "slow clients" . . . Unicorn isn't designed to handle slow clients.</p> <p>I will let you know if we see continued success with Puma, but so far so good. The switch is pretty painless, assuming your app is thread-safe.</p> <p>Here are the puma settings we are using. We are using "Clustered Mode".</p> <p>procfile:</p> <pre><code>web: bundle exec puma -p $PORT -C ./config/puma.rb </code></pre> <p>puma.rb:</p> <pre><code>environment ENV['RACK_ENV'] threads Integer(ENV["PUMA_THREADS"] || 5),Integer(ENV["PUMA_THREADS"] || 5) workers Integer(ENV["WEB_CONCURRENCY"] || 4) preload_app! on_worker_boot do ActiveSupport.on_load(:active_record) do ActiveRecord::Base.establish_connection end end </code></pre> <p>We currently have <code>WEB_CONCURRENCY</code> set to 4 and <code>PUMA_THREADS</code> set to 5.</p> <p>We aren't using an initializer for DB_POOL, just using the default DB_POOL setting of 5 (hence the 5 threads).</p> <p>The only reason we are using <code>WEB_CONCURRENCY</code> as our environment variable name is so that log2viz reports the correct number of workers. Would rather call it <code>PUMA_WORKERS</code> but whatever, not a huge deal.</p> <p>Hope this helps . . . again, will let you know if we see any issues with Puma.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload