gpt4 book ai didi

ruby-on-rails - 使用 memcached 或 redis 的 Rails cache_store 不会产生性能提升

转载 作者:可可西里 更新时间:2023-11-01 11:44:19 25 4
gpt4 key购买 nike

我正在使用 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%。但是后来我改成memcached :dalli_store 性能甚至略有下降,这是出乎意料的。然后我觉得可能是这个store有问题,于是尝试了:redis_store。相同的结果。

这里会出什么问题?

最佳答案

事实证明,它没有任何问题。小缓存元素也是如此。但它可以很好地扩展更大的数据。

关于ruby-on-rails - 使用 memcached 或 redis 的 Rails cache_store 不会产生性能提升,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16836847/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com