about summary refs log tree commit diff
path: root/config/puma.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-02 16:38:54 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-02 16:38:54 +0100
commite7723ab6625d3cd48b44ddbd340854ea960706f6 (patch)
tree57dcdc4fa9a0b7e66f338382e807a0c96ab1bb60 /config/puma.rb
parent53fb7b1aa84a76d66ef6973208e1c76a100774f3 (diff)
Add puma preloading, decrease DB pool size to size of threads per worker
Diffstat (limited to 'config/puma.rb')
-rw-r--r--config/puma.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/config/puma.rb b/config/puma.rb
index e8212125f..ad2dbfffd 100644
--- a/config/puma.rb
+++ b/config/puma.rb
@@ -30,7 +30,7 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 }
 # you need to make sure to reconnect any threads in the `on_worker_boot`
 # block.
 #
-# preload_app!
+preload_app!
 
 # 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
@@ -39,9 +39,9 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 }
 # or connections that may have been created at application boot, Ruby
 # cannot share connections between processes.
 #
-# on_worker_boot do
-#   ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
-# end
+on_worker_boot do
+  ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
+end
 
 # Allow puma to be restarted by `rails restart` command.
 plugin :tmp_restart