Skip to content
Extraits de code Groupes Projets
Valider e7723ab6 rédigé par Eugen Rochko's avatar Eugen Rochko
Parcourir les fichiers

Add puma preloading, decrease DB pool size to size of threads per worker

parent 53fb7b1a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
default: &default default: &default
adapter: postgresql adapter: postgresql
pool: 17 pool: <%= ENV["DB_POOL"] || ENV['RAILS_MAX_THREADS'] || 5 %>
timeout: 5000 timeout: 5000
encoding: unicode encoding: unicode
......
...@@ -30,7 +30,7 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 } ...@@ -30,7 +30,7 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 }
# you need to make sure to reconnect any threads in the `on_worker_boot` # you need to make sure to reconnect any threads in the `on_worker_boot`
# block. # block.
# #
# preload_app! preload_app!
# The code in the `on_worker_boot` will be called if you are using # The code in the `on_worker_boot` will be called if you are using
# clustered mode by specifying a number of `workers`. After each worker # clustered mode by specifying a number of `workers`. After each worker
...@@ -39,9 +39,9 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 } ...@@ -39,9 +39,9 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 }
# or connections that may have been created at application boot, Ruby # or connections that may have been created at application boot, Ruby
# cannot share connections between processes. # cannot share connections between processes.
# #
# on_worker_boot do on_worker_boot do
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
# end end
# Allow puma to be restarted by `rails restart` command. # Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart plugin :tmp_restart
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter