alvesjtiago / fastentry Goto Github PK
View Code? Open in Web Editor NEWCache management for Rails
License: MIT License
Cache management for Rails
License: MIT License
We're experiencing performance issues when using this gem.
We have built rails app only using this gem as cache dashboard.
On staging where cache store is not that big, it's working fine, but in production where we have bigger cache it's crashing every few clicks, even on instance with alot of resources.
Is this something you're aware of? Is there anything we're doing wrong or gem is lacking performance on bigger cache stores?
Thank you for this nice and useful project.
I was checking the fastentry.rb
file and noticed the usage of Redis.keys
https://github.com/alvesjtiago/fastentry/blob/master/lib/fastentry.rb#L73
According to the official docs: https://redis.io/commands/keys
Redis.keys
should be avoided on production environment especially for large redis databases.
One solution I can think of is to fetch the the first patch of keys. Then when displaying start paginating the rest of the keys.
An error occurs when getting access dashboard controller with no cache keys exists using redis cache.
In detail, adjusted_amount
returns 0
when no cache keys exists.
Then redis command SCAN 0 COUNT 0
is processed and Redis::CommandError
thrown.
Lines 99 to 102 in 7f4d690
We need to adjust count to always greater than 0 if using redis cache?
My environment
So I have a simple Rack proxy in my Rails app that simply proxies certain requests...
require 'rack/proxy'
class Webpack::DevServerProxy < Rack::Proxy
def perform_request(env)
# does something here...
@app.call(env)
end
end
Running Fastentry results in an ArgumentError
exception: Unsupported cache type
on @app.call(env)
.
Any ideas? thx
Nice project :)
Just trying it noticed it doesn't work with Dalli
gem.
config.cache_store = :mem_cache_store, HOST], {compress: true, pool_size: 50, raise_errors: false }
First I got an error about using a connection pool, but even when no connection pool is used I get this error:
NoMethodError: undefined method
keys' for #Dalli::Client:0x...`
We just tried to deploy this on Rails 5.0 and got a failure on precompile
Sprockets::FileNotFound: couldn't find file 'rails-ujs' with type 'application/javascript'
per https://github.com/rails/rails-ujs/tree/master it was merged into Rails 5.1 and on Rails 5.0 we need to install it by, for example, gem 'rails-ujs'
I, [2019-08-01T23:04:26.805920 #368] INFO -- : Writing /tmp/build_d8e573ed04088d976e972a9313d20c49/public/assets/fastentry/logo-ad1f85a9141125a4db1515c97e98bb768bd1fc4e5d70f5061ece2d6a4d895b18.png
rake aborted!
Sprockets::FileNotFound: couldn't find file 'rails-ujs' with type 'application/javascript'
Checked in these paths:
/tmp/build_d8e573ed04088d976e972a9313d20c49/app/assets/images
/tmp/build_d8e573ed04088d976e972a9313d20c49/app/assets/javascripts
/tmp/build_d8e573ed04088d976e972a9313d20c49/app/assets/stylesheets
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/assets/javascripts
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/assets/stylesheets
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/logster-2.3.0/vendor/assets/javascripts
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/fastentry-0.1.15/app/assets/config
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/fastentry-0.1.15/app/assets/images
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/fastentry-0.1.15/app/assets/javascripts
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/fastentry-0.1.15/app/assets/stylesheets
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/bundler/gems/apitome-75b1d243186b/app/assets/javascripts
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/bundler/gems/apitome-75b1d243186b/app/assets/stylesheets
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/bundler/gems/apitome-75b1d243186b/vendor/assets/javascripts
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/bundler/gems/apitome-75b1d243186b/vendor/assets/stylesheets
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/pghero-2.2.1/app/assets/images
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/pghero-2.2.1/app/assets/javascripts
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/pghero-2.2.1/app/assets/stylesheets
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/bundler/gems/apitome-75b1d243186b/assets/stylesheets
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/bundler/gems/apitome-75b1d243186b/assets/javascripts
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/fastentry-0.1.15/app/assets/javascripts/fastentry/application.js:13
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/resolve.rb:65:in `resolve!'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:399:in `resolve'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:207:in `process_require_directive'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:180:in `block in process_directives'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:178:in `each'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:178:in `process_directives'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:83:in `_call'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/directive_processor.rb:68:in `call'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/bundle.rb:23:in `block in call'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/utils.rb:200:in `dfs'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/bundle.rb:24:in `call'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:142:in `block in find'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `each'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `stat_directory'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:227:in `stat_tree'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:231:in `block in stat_tree'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `each'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `stat_directory'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:227:in `stat_tree'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `each'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `each'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `logical_paths'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:140:in `find'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
/tmp/build_d8e573ed04088d976e972a9313d20c49/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.