我有一个使用Memcachier(Dalli作为客户端)部署到Heroku的Rails应用程序 . 我正在使用免费的附加组件(它提供25 MB的缓存) .
我们开始接收来自heroku的请求超时,经过调试,我们发现手动刷新Memcachier解决了这个问题 .
当Memcachier达到接近其限制的水平时发生超时,例如20 MB(当限制为25 MB时) .
为什么Memcachier不会随着时间的推移释放缓存空间?是否 missing configuration 告诉Memcachier flush when cache reach certain size ?
我的conf:
application.rb中
config.cache_store = :dalli_store
production.rb
client = Dalli::Client.new
config.action_dispatch.rack_cache = {
:metastore => client,
:entitystore => client,
:allow_reload => false
}
1 回答
也许尝试更新
production.rb
以包含socket_timeout
和socket_failure_delay
选项 .如果您使用 Puma ,则需要安装
connection_pool
gem .的Gemfile
并在您的production.rb中进行此配置