优化APC缓存 [英] Optimize APC Caching

查看:135
本文介绍了优化APC缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的APC运行方式的链接:[已删除]

here is a link to how my APC is running : [removed]

如您所见,它很快就会填满,并且我的高速缓存满计数"有时会超过1000

As you can see, it fills up pretty quickly and my Cache Full Count goes over 1000 sometimes

我的网站使用Wordpress.

My website uses Wordpress.

我注意到,每次发布新帖子或编辑帖子时,都会发生2件事.

I notice that every time I make a new post or edit a post, 2 things happen.

1)重置APC存储器"USED" 2)我得到很多碎片

1) APC Memory "USED" resets 2) I get a whole lot of Fragments

我曾尝试为APC提供更多内存(512 mb),但有时它会崩溃,这似乎是384最好的.我还有一个Cron作业,它每4小时重新启动apache,清除所有APC的碎片和已用内存.同样,如果APC长时间运行,我的Apache崩溃了,我认为是由于碎片堆积所致.

I've tried giving more Memory to APC (512 mb) but then it crashes sometimes, it seems 384 is best. I also have a Cron job that restarts apache, clearing all APC of fragments and used memory, every 4 hours. Again, my apache crashes if APC is running for a long period of time, I think due to the fragment buildup.

我应该使用apc.Filters过滤掉一些不应该缓存的东西吗?

Should I use the apc.Filters and filter out some stuff that should not be cached?

我真的是这种东西的初学者,所以如果有人可以详细解释说明,非常感谢!!!

I am really beginner at this sort of stuff, so if someone can explain with full instructions, Thank you very much !!!

推荐答案

APC ttl应该负责片段的建立.我通常将其设置为7200.我正在使用WordPress在小型VPS上运行它,而我的设置是:

The APC ttl should take care of fragment build up. I usually set it at 7200. I am running it on a small VPS with WordPress and my settings are:

apc.enabled=1
apc.shm_segments=3
apc.shm_size=32
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=2048
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1
apc.max_file_size=10M

通过使用WordPress的内置对象缓存,您还将从中获得更多好处,Mark Jaquith写了一个非常好的

You will also get a lot more benefit from it by using WordPress's built in object cache and Mark Jaquith wrote a really good drop in plugin that should also help with some of your fragmentation issues when saving or editing a post.

这篇关于优化APC缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆