diff --git a/templates/puma.rb b/templates/puma.rb index e37a872ab..e64a0c7ff 100644 --- a/templates/puma.rb +++ b/templates/puma.rb @@ -3,8 +3,17 @@ # The environment variable WEB_CONCURRENCY may be set to a default value based # on dyno size. To manually configure this value use heroku config:set # WEB_CONCURRENCY. -workers Integer(ENV.fetch("WEB_CONCURRENCY", 3)) -threads_count = Integer(ENV.fetch("MAX_THREADS", 5)) +# +# Increasing the number of workers will increase the amount of resting memory +# your dynos use. Increasing the number of threads will increase the amount of +# potential bloat added to your dynos when they are responding to heavy +# requests. +# +# Starting with a low number of workers and threads provides adequate +# performance for most applications, even under load, while maintaining a low +# risk of overusing memory. +workers Integer(ENV.fetch("WEB_CONCURRENCY", 2)) +threads_count = Integer(ENV.fetch("MAX_THREADS", 2)) threads(threads_count, threads_count) preload_app!