【问题标题】:Magento - configuring memcachedMagento - 配置 memcached
【发布时间】:2011-03-03 09:42:54
【问题描述】:

我正在尝试使用 Magento 配置内存缓存。

查看代码,我在 local.xml.additional 中看到了一些配置,我还看到了将缓存配置放在 local.xml 中的示例

所以,我单独留下了 local.xml.additional 文件,并将以下内容放在 local.xml 中

<cache>
<slow_backend>File</slow_backend>
<fast_backend>memcached</fast_backend>
<fast_backend_options>
  <servers>
    <server>
      <host>localhost</host>
      <port>11211</port>
      <persistent>1</persistent>
    </server>
  </servers>
</fast_backend_options>

<backend>memcached</backend>
<memcached>
  <servers>
    <server>
      <host>localhost</host>
      <port>11211</port>
      <persistent>1</persistent>
    </server>
  </servers>
</memcached>
</cache>

但正在运行:

远程登录本地主机 11211

刷新 Magento 页面时似乎没有显示任何内容。

我需要任何进一步的配置吗?

谢谢

更新:

运行:

memcached -vv

并刷新页面,给我以下输出:

<29 new auto-negotiating client connection
29: Client using the ascii protocol
<29 stats
<30 new auto-negotiating client connection
30: Client using the ascii protocol
<30 stats
<31 new auto-negotiating client connection
31: Client using the ascii protocol
<31 get 28e_CORE_CACHE_OPTIONS
>31 END
<31 stats
<31 delete 28e_TRANSLATE_EN_GB_FRONTEND_1_DEFAULT_XXXXX
>31 NOT_FOUND

这是否意味着 memcache 正在我的商店中工作?

再次感谢

【问题讨论】:

  • 请格式化您的配置值,以便我们可以读取 xml 结构
  • @Jonathan Day 请查看我的更新问题

标签: magento memcached


【解决方案1】:

当您远程登录到 memcached 服务器时,运行stats,您将看到自启动 memcached 服务以来发生了多少缓存命中和未命中。这应该可以很好地表明 Magento 正在访问缓存。

【讨论】:

  • 好吧,当我运行那个命令然后运行'stats'时,'STAT bytes_read'和'STAT bytes_written'似乎增加了,不管我是否刷新页面。当我刷新我的 magento 商店时会发生什么?
【解决方案2】:

您必须确保您的 PHP 环境包含 memcached 扩展 但是安装它非常简单快捷 比如通过 apt-get 安装 ubuntu 和 debian

【讨论】:

    猜你喜欢
    • 2011-09-09
    • 1970-01-01
    • 2017-07-07
    • 2016-05-12
    • 2012-12-03
    • 1970-01-01
    • 1970-01-01
    • 2011-03-28
    • 1970-01-01
    相关资源
    最近更新 更多