簡體   English   中英

具有memcached或Redis的Rails cache_store不會提高性能

[英]Rails cache_store with memcached or redis does not produce performace boost

我在玩Rails的緩存。 我的更改按以下順序在development.rb中:

  1. config.cache_store =:file_store,“#{Rails.root} / tmp / cache”
  2. config.cache_store =:dalli_store,{:namespace =>'pinukimmm',:expires_in => 1.day,:compress => true}
  3. config.cache_store =:redis_store,“ redis:// localhost:6379/0 / cache”,{expires_in:90.minutes}

:file_store大大提高了緩存的速度。 增長約900%。 但是后來我使用:dalli_store更改為memcached,性能甚至略有下降,這是出乎意料的。 然后我以為這家商店可能有問題,所以我嘗試了:redis_store。 結果相同。

這里可能出什么問題?

事實證明,這沒有錯。 小型緩存元素也是如此。 但是隨着更大的數據,它可以很好地擴展。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM