簡體   English   中英

Magento + APCu緩存問題。 網站運行緩慢,緩存未命中次數多於命中次數

[英]Magento + APCu caching issue. Site is slow and there is more cache misses than hits

我在LEMP Stack上運行了Magento 1.7.0.2安裝; Nginx + PHP-FPM(PHP v5.5.6 w / APCu v4.0.2)+ Percona。

我已經將我的magento配置為使用APCu緩存,如下所示:

應用程序的/ 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信息頁面,顯示巨大的未命中率:

在此處輸入圖片說明

知道有什么問題嗎?

我們有同樣的問題。 經過數天的更改,這是一個簡單的解決方案。

在您使用過的local.xml文件中

<prefix>BDWEB_</prefix>

由於某些原因,Magento和APCu僅接受前綴中的字母數字字符,因此我們發現刪除下划線“ _”解決了我們的問題

APC設置似乎很好。 您可以下一步:

1)清除Magento網站根文件夾中的var / cache。

2)檢查,您是否啟用了eAccelerator? 如果是,請禁用它。

順便說一句,APC並不是Magento緩存的好工具,因為Magento使用內置的基於Zend的緩存。

暫無
暫無

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

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