[solved] Max Idle Time

John Doe

Active Member
#1
Hello, I have been testing the last few weeks and what I discovered is that PHP caching system like Xcache do not function properly when litespeed has "Max Idle Time" set to anything higher than -1. I notice that when I set the max idle time to -1 Xcache will now cache everything without a problem.

My question is, will the be any consequences if I leave the Max Idle Time to -1?
 
Last edited by a moderator:

John Doe

Active Member
#7
Code:
[root@srv01 ~]# export LANG=C
[root@srv01 ~]# pstree -p
init(1)-+-brcm_iscsiuio(11520)-+-{brcm_iscsiuio}(11521)
        |                      |-{brcm_iscsiuio}(11522)
        |                      `-{brcm_iscsiuio}(11524)
        |-cpanellogd(32676)
        |-cpdavd(32428)
        |-cphulkd(28338)
        |-cpsrvd-ssl(3663)
        |-crond(27655)
        |-dbus-daemon(11978)
        |-dccifd(12129)---dccifd(12130)-+-{dccifd}(12132)
        |                               `-{dccifd}(12134)
        |-dccm(12093)---dccm(12095)-+-{dccm}(12108)
        |                           |-{dccm}(12109)
        |                           `-{dccm}(12110)
        |-dovecot(22374)-+-dovecot-auth(22375)
        |                |-imap-login(22428)
        |                |-imap-login(22429)
        |                |-pop3-login(22426)
        |                `-pop3-login(22427)
        |-exim(14059)
        |-funcd(6138)
        |-hald(32754)---hald-runner(32755)
        |-klogd(11892)
        |-lfd(32034)
        |-litespeed(3199)-+-httpd(3201)
        |                 |-litespeed(3206)---lsphp5(3347)-+-lsphp5(1413)
        |                 |                                |-lsphp5(4013)
        |                 |                                |-lsphp5(5920)
        |                 |                                |-lsphp5(7512)
        |                 |                                |-lsphp5(7518)
        |                 |                                |-lsphp5(7702)
        |                 |                                |-lsphp5(31868)
        |                 |                                `-lsphp5(31944)
        |                 `-litespeed(3207)
        |-mysqld_safe(18049)---mysqld(18329)-+-{mysqld}(18380)
        |                                    |-{mysqld}(19484)
        |                                    |-{mysqld}(19485)
        |                                    |-{mysqld}(19581)
        |                                    |-{mysqld}(19595)
        |                                    |-{mysqld}(19762)
        |                                    |-{mysqld}(24240)
        |                                    |-{mysqld}(24255)
        |                                    |-{mysqld}(24256)
        |                                    |-{mysqld}(24257)
        |                                    |-{mysqld}(24258)
        |                                    |-{mysqld}(24495)
        |                                    |-{mysqld}(24496)
        |                                    |-{mysqld}(24497)
        |                                    |-{mysqld}(24499)
        |                                    |-{mysqld}(24500)
        |                                    |-{mysqld}(24501)
        |                                    |-{mysqld}(24502)
        |                                    |-{mysqld}(24509)
        |                                    |-{mysqld}(24510)
        |                                    |-{mysqld}(24511)
        |                                    |-{mysqld}(24534)
        |                                    |-{mysqld}(24536)
        |                                    |-{mysqld}(24539)
        |                                    |-{mysqld}(24561)
        |                                    |-{mysqld}(12019)
        |                                    |-{mysqld}(12020)
        |                                    |-{mysqld}(12023)
        |                                    |-{mysqld}(12026)
        |                                    |-{mysqld}(12027)
        |                                    |-{mysqld}(12028)
        |                                    |-{mysqld}(13485)
        |                                    |-{mysqld}(13486)
        |                                    |-{mysqld}(15521)
        |                                    |-{mysqld}(15522)
        |                                    |-{mysqld}(15526)
        |                                    |-{mysqld}(15527)
        |                                    |-{mysqld}(17493)
        |                                    |-{mysqld}(17521)
        |                                    |-{mysqld}(17522)
        |                                    |-{mysqld}(5636)
        |                                    `-{mysqld}(5637)
        |-named(11945)-+-{named}(11946)
        |              |-{named}(11947)
        |              |-{named}(11948)
        |              |-{named}(11949)
        |              |-{named}(11950)
        |              |-{named}(11952)
        |              |-{named}(11953)
        |              |-{named}(11954)
        |              |-{named}(11955)
        |              `-{named}(11956)
        |-portsentry(3239)
        |-pure-authd(25969)
        |-pure-ftpd(25965)
        |-python2.6(22377)
        |-queueprocd(32588)
        |-spamd(22222)---spamd(22302)
        |-sshd(18398)---sshd(27793)---bash(27824)---pstree(18284)
        |-syslogd(11885)
        |-tailwatchd(32748)
        `-udevd(11360)
 

NiteWave

Administrator
#8
Code:
        |                 |-litespeed(3206)---lsphp5(3347)-+-lsphp5(1413)
        |                 |                                |-lsphp5(4013)
        |                 |                                |-lsphp5(5920)
        |                 |                                |-lsphp5(7512)
        |                 |                                |-lsphp5(7518)
        |                 |                                |-lsphp5(7702)
        |                 |                                |-lsphp5(31868)
        |                 |                                `-lsphp5(31944)
see above, there is only one parent lsphp5 process, other lsphp5 processes are child of the parent. in this case, in-memory opcode cache(APC,XCache) are shared by all lsphp5 process. as long as parent lsphp5(3347) is not killed, the in-memory opcode cache will be resident in memory and "function well".

note: killing or starting new sub lsphp5 process, will not affect in-memory opcode cache.

so your setting "Max Idle Time=-1" may help parent lsphp5 persistent in memory and hence XCache is persistent in memory too between requests.

however set "Max Idle Time=-1" no good in shared-hosting env:
"This feature allows resources used by idle applications to be freed. It is especially useful in mass hosting environment when you need to define many applications running in setuid mode for the sake of maximum security." --- tip for "Max Idle Time" in lsws admin console.

so to determine if your XCache is purged or not, you can also check if the parent lsphp5 pid has changed. if for some reason it changed(for example, kill -9 pid), xcache is purged.
 

John Doe

Active Member
#9
Thank you for the detailed explanation. Yes, I have notice that once I set max idle time to -1 I now see (Xcache and APC) actually caching. Xcache would cancel itself every 15 minutes (Note: I have already disabled log rotation on my sever and the bandwidth stats are set to update once every 24) I set the settings like this so that I can run the sever for at least 24h before having Litespeed restart. With that being done, the only differential factor would be litespeed Max Idle Time settings and I was not able to get any cache working without having it set to -1.

Anyway, since im not ruining a hosting company these setting seem to be fine. Thank you for verify that.

Best Regards,
Jon Doe
 
Top