只需在 PHP 上安装并启用 APC 就能加快我的代码速度吗?
我一直在研究缓存和其他解决方案来加速我的服务器。我注意到的一件事是,APC 似乎被反复提及作为一个很好的解决方案。当然,我知道我们可以使用 apc_store、apc_fetch 等来实现一些调整...
我想知道的是,如果我在我的服务器上安装并启用 APC on PHP,它会开始发挥其魔力吗? (也许我需要做 apc_compile_file?)
当然我可以调整设置等,但我认为使用 1GB RAM 和默认设置它应该立即开始工作!?!?
I have been looking into caching and other solutions to speed up my server. One thing I have noticed is that APC seems to be mentioned again and again as a good solution. Of course, I understand there are tweaks we can implement using apc_store, apc_fetch etc...
What I am wondering is, if I install and enable APC on PHP on my server will it just start working its magic? (Perhaps I need to do apc_compile_file? )
Of course I can tweak settings, etc, but I think with 1gb of RAM and default settings it should start working immediately!?!?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
APC 会加速您的代码,因为它不仅是键值缓存,而且还是操作码-cacher。
1GB RAM 很好,但 APC 的默认缓存大小 = 32Mb。您可以在 php.ini 或 apc.ini 中更改此设置:
根据您的要求选择缓存大小。
要查看使用了多少 RAM,请运行 apc.php - 您可以在 APC 源代码中找到此脚本。
APC will speed up your code because it's not only key-value cache, it's opcode-cacher too.
1gb of RAM it's good, but APC has default size of cache = 32Mb. You can change this setting in your php.ini or apc.ini:
Choose size of cache by your requirements.
To see, how much of RAM is used, run apc.php - you can find this script in sources of APC.