mod_fcgid流程和终身了XCache [英] mod_fcgid processes and XCache lifetime

查看:236
本文介绍了mod_fcgid流程和终身了XCache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用mod_fcgid和3.0.3了XCache,PHP 5.4.18。我知道,由于mod_fcgid设计,我不能用一个共同的共享内存,因此每个PHP-CGI进程在其一生中使用它自己的高速缓存。

I use mod_fcgid and Xcache 3.0.3, PHP 5.4.18. I know that due to mod_fcgid design, I can't use a common shared memory, so every php-cgi process uses its own cache during its lifetime.

当我打开和检查 PHP-CGI 流程我看到这一点:

When I open top and check for php-cgi processes I see this:

PID     USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
14827 examplecom  20   0  230m  34m  18m S 11.0  3.4   0:07.07 php-cgi
14840 examplecom  20   0  242m  45m  18m S  0.7  4.6   0:02.74 php-cgi
14802 examplecom  20   0  237m  41m  18m S  6.3  4.2   0:11.39 php-cgi
14816 examplecom  20   0  232m  36m  18m S  1.7  3.7   0:07.75 php-cgi
14824 examplecom  20   0  231m  34m  18m S  8.6  3.5   0:06.12 php-cgi
14838 examplecom  20   0  229m  33m  17m S  0.7  3.3   0:00.89 php-cgi
14841 examplecom  20   0  228m  32m  18m S  2.0  3.3   0:01.71 php-cgi
14839 examplecom  20   0  228m  32m  18m R  8.6  3.2   0:01.58 php-cgi

然后我检查了XCache管理面板。每次我刷新管理页面我看到另一个进程的数据。比如我看到:

Then I check XCache admin panel. Everytime I refresh admin page I see another process' data. For example I see that:

XCache Cacher
XCache Cacher Module    enabled 
Readonly Protection     disabled 
Page Request Time   2013-09-04 21:59:32 
Cache Init Time     2013-09-04 21:59:05 
Cache Instance Id   14827 
Opcode Cache    enabled, 12,582,912 bytes, 1 split(s), with 8192 slots each 
Variable Cache  enabled, 1,048,576 bytes, 1 split(s), with 8192 slots each 
Shared Memory Schemes   mmap 

好像进程 14827 生活了27秒。但是,当我检查这一过程适用于0:07.07

It seems like process 14827 lives for 27 seconds. But when I check top that process works for 0:07.07.

也是如此PID 14827 住7分钟或27秒。这是正确的还是我错过了XCache将内部运作​​的东西吗?

So does PID 14827 lives for 7 minutes or 27 seconds. Which is correct or do I miss something with the XCache inner workings?

是不是更好的选择来改变 /etc/httpd/conf.d/fcgid.conf ,让每一个进程的生存时间?或者是坏主意改变默认值

Is it better option to change /etc/httpd/conf.d/fcgid.conf and make each process' lifetime longer ? Or is it bad idea to change default values.

我能做些什么更多的优化,使 XCache将 mod_fgid 更好地工作? (我不preFER改变我的服务器nginx的,并迁移到的mod_fastcgi)

What optimization can I do more to make XCache and mod_fgid work better ? (I don't prefer to change my server to nginx, and migrate to mod_fastcgi)

推荐答案

我不知道了XCache,但是......

I don't know XCache, but...

让我们说我们有
1 apache进程
3 PHP进程

let's say we have 1 apache process 3 php processes

3的所有PHP进程正在运行。所有3具有相同的运行时间。 //现在时间是0000

all 3 php processes are running. All 3 have same "running time". // time now is 0000

您请求的一些页面。
阿帕奇连接到处理#1,高速缓存被启动。 //初始化的缓存时间为0001

You request some page. Apache connect to process#1, cache is initiated. // cache init time is 0001

您刷新页面。
阿帕奇连接到处理#2,高速缓存被启动。 //初始化的缓存时间为0033

you refresh page. Apache connect to process#2, cache is initiated. // cache init time is 0033

现在,你有3个流程,所有3个正在运行的时间,因为0000,但

Now you have 3 processes, all 3 are running since time 0000, but

进程#1有initCacheTime 0001

process#1 have initCacheTime 0001

进程#2有initCacheTime 0033

process#2 have initCacheTime 0033

进程#3没有initatedCacheTime,cuz它尚未使用。

process#3 do not have initatedCacheTime, cuz it is not used yet.

这篇关于mod_fcgid流程和终身了XCache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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