Just starting to introduce caching into a new Rails app. We first set the cache_store to use :memory_store
in the application.rb
config.cache_store = :memory_store
I then ran some performance tests through NewRelic to see performance before/after model caching occurred.
After that I switched the cache_store to use :dalli_store since it is the currently recommended gem to use memcached with Rails.
config.cache_store = :dalli_store
I then reran the same before/after caching tests against memcached. There was still an obvious improvement between the cached vs non-cached request/response; however the memcached cached performance was consistently twice as slow (roughly) as the standard Rails :memory_store.
Just for clarification, during these tests I ran the memcached server local to the rails web application so as to avoid adding network latency issues into the mix.
All of this leads me to the following real questions then.
Is it typical to see faster performance from
:memory_store
over:dalli_store
?If it is not typical, are there some 'tricks' I don't know besides the standard setup required to get proper performance from memcached?
If it is typical, then why people using memcached and :dalli_store on Rails in the first place? Is it a matter of scalibility, etc...?