about summary refs log tree commit diff
path: root/config/environments/production.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-02 13:30:52 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-02 13:30:52 +0100
commit53fb7b1aa84a76d66ef6973208e1c76a100774f3 (patch)
treea2cc757d90f8ea87a258de1a0b9a062f12bc1f30 /config/environments/production.rb
parenta59d10d3df21befac6da57d92aed3087b7c10d6a (diff)
Replace in-memory cache store with redis store, should decrease memory
footprint of each running process by 128mb
Diffstat (limited to 'config/environments/production.rb')
-rw-r--r--config/environments/production.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/config/environments/production.rb b/config/environments/production.rb
index b90505f68..f2071f7a2 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -45,7 +45,12 @@ Rails.application.configure do
   # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
 
   # Use a different cache store in production.
-  config.cache_store = :memory_store, { size: 128.megabytes }
+  config.cache_store = :redis_store, {
+    host: ENV['REDIS_HOST'] || 'localhost',
+    port: ENV['REDIS_PORT'] || 6379,
+    db: 0,
+    namespace: 'cache'
+  }
 
   # Enable serving of images, stylesheets, and JavaScripts from an asset server.
   # config.action_controller.asset_host = 'http://assets.example.com'