Memcache 和 APC 可以很好地结合起来吗?
我已经安装了 PHP5 - PHP5-MEMCACHE - PHP-APC。
他们能像这样一起工作吗?这些模块的加载速度会很快吗?
我尝试使用它们,但我没有“看到”特别的差异,也许这些模块对 CPU 的使用较少。我的网站流量不高,但是如果能节省资源就更好了!
谢谢
I have installed PHP5 - PHP5-MEMCACHE - PHP-APC.
Can they work like that together? Will the loading be fast with these modules ?
I tried to use them, I don't "see" particular differences, maybe the CPU is used less with these modules. My website doesn't have high traffic, but If i can save resources is better!
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
APC 保留 PHP 字节码的缓存。 Memcache 保存您设置的变量的缓存。
所以答案是肯定的,他们可以。它们是为不同的事情而设计的。
APC keeps cache of PHP bytecode. Memcache keeps cache of your vars, that you set.
So answer is Yes, they can. They're made for different things.
它们协同工作得很好,你只需要正确使用它们即可:
They work together very well, you just need to use them properly :
是的,他们可以一起工作。它们是否会在生产系统上运行是另一回事......
就我个人而言,我不得不放弃尝试让以下内容在任何延长的时间内工作:
它会运行一段时间,但在压力测试后 php 会出错。我可以通过 /etc/init.d/php-fastcgi 重新启动 php-fastcgi,事情会持续一段时间,但它总是迟早会再次崩溃。
我可以运行其中一个/或没有问题,但是两者一起不会为我合作。仅供参考,我尝试使用二进制文件(apt-get 软件包)、安装为 PECL 扩展、下载源代码,但所有道路都导致我走向同样的悲惨命运。我还尝试运行 memache 守护进程 local &远程在我的网络主机上,但结果相同。
Yes, they can work together. Whether they will on a production system is another story...
Personally, I had to give up trying to get the following to work for any extended period of time:
It will run for awhile, but after stress testing php errors out. I can restart php-fastcgi via /etc/init.d/php-fastcgi and things will role along for some time more, but it always crashes again sooner than later.
I can run either/or without issue, but the two together won't cooperate for me. FYI I tried using binaries (apt-get packages), installing as PECL extensions, downloading source, but all roads lead me to the same sad fate. I also tried running the memache daemon local & remotely on my web host, but same outcome.
我正在开发基于 JavaScript 和 PHP 的大型多人在线游戏。我们正在使用它们。我不能告诉你更多,因为我只是前端开发人员,但是我认为如果 APC 和 memcache 不好,我们就不会使用它。
I'm working on mmo game based on JavaScript and PHP. We are using both of them. I can't tell you more, beacause I am only frontend developer, however I think if APC and memcache were bad we were not using it.