Skip to content
Snippets Groups Projects
Commit 53fb7b1a authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Replace in-memory cache store with redis store, should decrease memory

footprint of each running process by 128mb
parent a59d10d3
No related branches found
No related tags found
No related merge requests found
...@@ -69,4 +69,5 @@ end ...@@ -69,4 +69,5 @@ end
group :production do group :production do
gem 'rails_12factor' gem 'rails_12factor'
gem 'lograge' gem 'lograge'
gem 'redis-rails'
end end
...@@ -256,6 +256,22 @@ GEM ...@@ -256,6 +256,22 @@ GEM
railties (>= 3.2) railties (>= 3.2)
tilt tilt
redis (3.3.1) redis (3.3.1)
redis-actionpack (5.0.0)
actionpack (>= 4.0.0, < 6)
redis-rack (~> 2.0.0.pre)
redis-store (~> 1.2.0.pre)
redis-activesupport (5.0.1)
activesupport (>= 3, < 6)
redis-store (~> 1.2.0)
redis-rack (2.0.0)
rack (~> 2.0)
redis-store (~> 1.2.0)
redis-rails (5.0.1)
redis-actionpack (~> 5.0.0)
redis-activesupport (~> 5.0.0)
redis-store (~> 1.2.0)
redis-store (1.2.0)
redis (>= 2.2)
ref (2.0.0) ref (2.0.0)
responders (2.3.0) responders (2.3.0)
railties (>= 4.2.0, < 5.1) railties (>= 4.2.0, < 5.1)
...@@ -396,6 +412,7 @@ DEPENDENCIES ...@@ -396,6 +412,7 @@ DEPENDENCIES
rails_autolink rails_autolink
react-rails react-rails
redis (~> 3.2) redis (~> 3.2)
redis-rails
rspec-rails rspec-rails
rspec-sidekiq rspec-sidekiq
rubocop rubocop
......
...@@ -45,7 +45,12 @@ Rails.application.configure do ...@@ -45,7 +45,12 @@ Rails.application.configure do
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production. # 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. # Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com' # config.action_controller.asset_host = 'http://assets.example.com'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment