[solved] Max Idle Time

Discussion in 'General' started by John Doe, Feb 4, 2012.

  1. John Doe

    John Doe Member

    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: Feb 6, 2012
  2. NiteWave

    NiteWave Administrator

    are you running php in which mode: suExec or not ?
  3. John Doe

    John Doe Member

    Nope, im not.
  4. NiteWave

    NiteWave Administrator

    can you paste output of "pstree -p" under litespeed process subtree ?
  5. John Doe

    John Doe Member

    For some reason I cannot paste it in the forums... I just get an empty post so I attached it instead.

    Attached Files:

    Last edited: Feb 6, 2012
  6. NiteWave

    NiteWave Administrator

    some 8-bit characters in it and hard to read.
    to resolve it, run "export LANG=C" before run "pstree -p"
  7. John Doe

    John Doe Member

    [root@srv01 ~]# export LANG=C
    [root@srv01 ~]# pstree -p
            |                      |-{brcm_iscsiuio}(11522)
            |                      `-{brcm_iscsiuio}(11524)
            |                               `-{dccifd}(12134)
            |                           |-{dccm}(12109)
            |                           `-{dccm}(12110)
            |                |-imap-login(22428)
            |                |-imap-login(22429)
            |                |-pop3-login(22426)
            |                `-pop3-login(22427)
            |                 |-litespeed(3206)---lsphp5(3347)-+-lsphp5(1413)
            |                 |                                |-lsphp5(4013)
            |                 |                                |-lsphp5(5920)
            |                 |                                |-lsphp5(7512)
            |                 |                                |-lsphp5(7518)
            |                 |                                |-lsphp5(7702)
            |                 |                                |-lsphp5(31868)
            |                 |                                `-lsphp5(31944)
            |                 `-litespeed(3207)
            |                                    |-{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}(11947)
            |              |-{named}(11948)
            |              |-{named}(11949)
            |              |-{named}(11950)
            |              |-{named}(11952)
            |              |-{named}(11953)
            |              |-{named}(11954)
            |              |-{named}(11955)
            |              `-{named}(11956)
  8. NiteWave

    NiteWave Administrator

            |                 |-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.
  9. John Doe

    John Doe Member

    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

Share This Page