gpt4 book ai didi

nginx - APC 净化率和碎片

转载 作者:行者123 更新时间:2023-12-03 17:46:36 29 4
gpt4 key购买 nike

我已经在Nginx,PHP-FPM,Varnish和APC设置上运行了Magento。

APC的碎片和吹扫率都很高。

碎裂在2小时内增加> 50%,然后缓慢上升到100%。

更令人不安的事实是,穆宁(Munin)表明清除率一直都在100%左右。

我试图将shm大小增加到1G(APC通常使用其中的200M,总RAM为6G),这没有帮助,还试图调整ttl:s,但没有任何运气。

是否有 Varnish 引起APC的持续清洗?

这是我的APC.ini

extension = apc.so
apc.enabled=1
apc.shm_segments=1
apc.shm_size=1024M
apc.num_files_hint=10000
apc.user_entries_hint=10000
apc.max_file_size=5M
apc.stat=0
apc.enable_cli = 1
apc.optimization=0
apc.cache_by_default=1
apc.slam_defense=0
apc.include_once_override=0
apc.ttl=3600
apc.user_ttl=7200
apc.gc_ttl = 600

apc.php:
**File Cache Information**
Cached Files 1053 ( 58.1 MBytes)
Hits 40172
Misses 1038
Request Rate (hits, misses) 102.26 cache requests/second
Hit Rate 99.68 cache requests/second
Miss Rate 2.58 cache requests/second
Insert Rate 10.41 cache requests/second
Cache full count 0

**User Cache Information**
Cached Variables 74 ( 1.2 MBytes)
Hits 374
Misses 5907
Request Rate (hits, misses) 15.59 cache requests/second
Hit Rate 0.93 cache requests/second
Miss Rate 14.66 cache requests/second
Insert Rate 0.18 cache requests/second
Cache full count 0

最佳答案

我发现有效保持APC正常运行的一个技巧是,将gc_ttl设置为600,但是将ttl设置为0。这效率较低,并且理论上会在非常繁忙的站点上造成踩踏事件,但会阻止碎片堆积。您还需要通过确保没有在缓存中放置过多的东西(即为其分配足够的内存)来降低清除速率。

这听起来可能违反直觉,但是当我今天在服务器上切换到这种方法时,就会发生以下情况:



This munin plug-in非常适合监视APC随时间的变化,比试图破译apc状态页要好得多。

关于nginx - APC 净化率和碎片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14919160/

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