【问题标题】:Magento + APCu caching issue. Site is slow and there is more cache misses than hitsMagento + APCu 缓存问题。网站速度很慢,缓存未命中次数多于命中次数
【发布时间】:2014-08-23 08:14:02
【问题描述】:

我有一个 Magento 1.7.0.2 安装在 LEMP Stack 上运行; Nginx + PHP-FPM (PHP v5.5.6 w/ APCu v4.0.2) + Percona。

我已将我的 magento 配置为使用 APCu 缓存,如下所示:

app/etc/local.xml

<config>
    <global>
        ...
        <cache>
            <backend>apc</backend>
            <prefix>BDWEB_</prefix>
        </cache>
    </global>
    ...
</config>

APC 配置如下:

/etc/php.d/apcu.ini

extension=apcu.so

apc.enabled          = 1
apc.shm_segments     = 1
apc.shm_size         = 512M
apc.ttl              = 7200
apc.user_ttl         = 7200
apc.num_files_hint   = 10240
apc.mmap_file_mask   = /tmp/apc.XXXXXXX
apc.enable_cli       = 1
apc.cache_by_default = 1
apc.max_file_size    = 10M
apc.stat             = 1

这是显示巨大未命中率的 apc 信息页面:

知道可能出了什么问题吗?

【问题讨论】:

    标签: magento caching nginx apc php


    【解决方案1】:

    我们遇到了同样的问题。经过几天的改变,这是一个简单的解决方案。

    在你使用过的local.xml文件中

    <prefix>BDWEB_</prefix>
    

    由于某种原因,Magento 和 APCu 将只接受前缀中的字母数字字符,因此我们发现删除下划线“_”解决了我们的问题

    【讨论】:

      【解决方案2】:

      APC 设置似乎没问题。接下来你可以做:

      1) 清除 Magento Web 根文件夹中的 var/cache。

      2) 检查,您是否启用了 eAccelerator?如果是 - 禁用它。

      顺便说一句,APC 不是 Magento 缓存的好工具,因为 Magento 使用内置的基于 Zend 的缓存。

      【讨论】:

        猜你喜欢
        • 2017-09-26
        • 1970-01-01
        • 2014-06-13
        • 2018-03-04
        • 1970-01-01
        • 2012-04-21
        • 1970-01-01
        • 2014-02-08
        • 2015-07-09
        相关资源
        最近更新 更多