调整 APC 以使用更少的 RAM
我有一个虚拟专用服务器,只允许我使用 128MB RAM。我最近安装了 APC for PHP,它消耗了超过 128MB 的空间。如果我没有记下该号码,我的提供商希望我升级我的帐户。是否有一个配置选项可用于设置 APC 的最大值?
I have a virtual private server that only allows me to use 128MB of RAM. I recently installed APC for PHP and it consumes more than 128MB. My provider wants me to upgrade my account if I don't get that number down. Is there a config option that I can use to set a maximum on APC?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 apc.shm_size 配置选项。 APC 配置
You can use the apc.shm_size config option. APC Configuration
看来您需要对
apc.shm_segments
和 < a href="http://www.php.net/manual/en/apc.configuration.php#ini.apc.shm-size" rel="nofollow noreferrer">apc.shm_size 更改总体内存交给APC。It seems you need to make changes to
apc.shm_segments
and apc.shm_size to change overall memory given to APC.APC 的目标是通过花费更多的内存来节省 CPU。
您必须允许足够的内存,以便您要缓存的页面将保留缓存以供下一个请求。 128M 很低,单个 WordPress 需要 20M
要降低所需的 RAM,您可以:
微调 APC 就是为他提供足够的 RAM,这样它就不必刷新缓存。
弗兰克·法默的建议很好。使用 apc.php。
有趣的是,看到每个人都在回答如何增加你实际上想降低记忆力的问题。他们因此得到了积分! :)
The goal of APC is to save CPU by spending more ram.
You have to allow enough ram so the pages you want to cache will stay cached for next request. 128M is low, a single Wordpress require 20M
To lower the ram required you can :
Fine tuning APC is about giving him enough RAM so it never have to flush cache.
Frank Farmer advice is good. Use apc.php.
It's funny to see everybody answering how to increase memory where you want to actually lower it. And they get point for that ! :)