哪里APC存储其运算code和用户变量缓存? [英] Where does APC store its opcode and user variable cache?

查看:162
本文介绍了哪里APC存储其运算code和用户变量缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问的原因是使用上方时,因为我没有看到像APC东西的过程。所以,我认为内存使用情况将在Apache的过程来解释。

The reason I ask is because when using top I don't see a process for anything like APC. So I assume that the memory usage would be accounted for in an apache process.

是这样的,这是否意味着APC使用内存中的每个Apache进程被复制,从而占用了比原先分配给它可能更多的内存?

Is that the case, and does that mean that the memory APC is using is replicated in each apache process, thereby taking up potentially much more memory than what was originally assigned to it?

如果是这样的话将内存缓存是一个更好的解决方案,即使它没有被多个loadbalanced服务器使用的?

If this is the case would memcache be a better solution, even if it's not being used on multiple loadbalanced servers?

推荐答案

APC使用共享内存来存储它的运算code缓存。在mod_php的的情况下,这个存储器的所有Apache进程间共享。因此30MB的高速缓存只占用30MB即使有5 Apache进程

APC uses shared memory to store its opcode cache. In the case of mod_php this memory is shared between all Apache processes. So a 30MB cache only takes up 30MB even if there are 5 Apache processes.

但是,在使用mod_php的时候,每一个Apache进程确实为每个进程包含PHP间preTER浪费了大量的资源。因此,当阿帕奇提供静态内容(HTML,CSS,JS,图像文件等),它使用与加载完整的PHP间preTER的过程。为了解决这个问题,有些人通过的mod_fastcgi或mod_fcgi使用FastCGI的。 使用FastCGI的运算code缓存变得有点棘手。

However, when using mod_php, each Apache process does waste a lot of resources as each process contains the PHP interpreter. Thus, when Apache serves static content (html, css, js, image files, etc) it uses a process with the full PHP interpreter loaded. To get around this, some people use FastCGI via mod_fastcgi or mod_fcgi. Using an opcode cache with FastCGI becomes a bit trickier.

目前还没有办法使用内存缓存为运code缓存。即使有,它可能会慢于期望的。

There is currently no way to use memcache as an opcode cache. Even if there was, it would probably be slower than desired.

这篇关于哪里APC存储其运算code和用户变量缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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