[Solved] xCache Error

Discussion in 'General' started by sux0r, Feb 16, 2011.

  1. sux0r

    sux0r Well-Known Member

    When i switch xcache.mmap_path

    xcache.mmap_path: /dev/zero --> to anything other than this.
    It fills the error log with -->

    [] [STDERR] PHP Warning: xcache_isset(): xcache.var_size is either 0 or too small to enable var data caching in /home/youth/public_html/forums/ips_kernel/classCacheXcache.php on line 95
    Heres my php.ini bit about xCache.

  2. webizen

    webizen Well-Known Member

    Do you mean when you switch xcache.mmap_path to anything other than /dev/zero, you start seeing these errors? but no problem if use /dev/zero, correct?
  3. sux0r

    sux0r Well-Known Member

    Yes, exactly o_O
  4. webizen

    webizen Well-Known Member

    What other path did you change to that caused the warning? It is more of an xcache setup issue in stead of LSWS issue.
  5. sux0r

    sux0r Well-Known Member

  6. NiteWave

    NiteWave Administrator

  7. sux0r

    sux0r Well-Known Member

    Tried /dev/shm/xcache

    As well with no luck o_O
  8. webizen

    webizen Well-Known Member

    is /dev/shm/xcache (file) writeable by the webserver running user (e.g. nobody)?
  9. sux0r

    sux0r Well-Known Member

    I corrected the permissions.
    And after tht im getting 503 errors.


    It seems one of the scripts is taking up too much memory o_O
    The current memory_limit = 128M
    Hw much do i need to increase this ?

    ~ Thanks :)
  10. NiteWave

    NiteWave Administrator

    how much is current memory soft/hard limit of lsphp5?

    Server->External App->lsphp5->
    Memory Soft Limit (bytes)
    Memory Hard Limit (bytes)

    increase it to 700M/750M(for example) and try again
  11. sux0r

    sux0r Well-Known Member

    Before it was set to the default values.
    I've set it to 700/750 and still getting the 503's
  12. NiteWave

    NiteWave Administrator

    how about disable xcache, if 503 error disappear?
  13. sux0r

    sux0r Well-Known Member

    the error only pops up wen i change
    xcache.mmap_path: /dev/zero --> to anything other than this.

    Currently i checkd with /dev/shm/xcache
  14. NiteWave

    NiteWave Administrator

    please set
    xcache.readonly_protection = on
    in php.ini

    I installed xcache 1.3.1, no 503 error when
    xcache.mmap_path = "/tmp/xcache"

    however I only did tests on phpinfo(). your 503 error is random, right?

    per my understanding, set xcache.mmap_path other than "/dev/zero", you must set
    xcache.readonly_protection = on
    as well.

    please inform if 503 error disappear or still there after change above setting.
  15. sux0r

    sux0r Well-Known Member

    Yes i tried as you've mentioned with no luck.
    And yes the errors are random.
  16. NiteWave

    NiteWave Administrator

    looks you run php in suExec mode, it's not a good idea to enable xcache/apc for it.

    how many lsphp processes are running? can estimate it with "ps -e|grep lsphp5|wc"

    each lsphp5 process will consume 70M+70M=140M xcache memory, and lsphp5 process will only run a short time once no more requests assigned to it.

    if you really want to enable xcache, run php in non-suExec mode. (but for shared hosting, usually this is not an option for security reason). in this mode, the total memory consumed by xcache will be much less since it can be shared among lsphp5 processes, and may be no more 503 error.
  17. sux0r

    sux0r Well-Known Member

    [root@sux0r ~]# ps -e|grep lsphp5|wc
    7 28 217

    I disabled suExec mode and alls working. :]
    Thanks :)
  18. MattW

    MattW Active Member

    Old thread I know, but this just helped me figure out why Xcache wouldn't start :)
    semprot likes this.
  19. semprot

    semprot Well-Known Member

    Why did you try other than /dev/zero/ ?
    When i tried /dev/shm/ , it gave me error too, so i use /dev/zero/ now.
    Does changing it other than /dev/zero/ will give significant boost?
  20. skooboy

    skooboy Active Member

    I can't seem to get it to work with anything other than "dev/zero". Can someone write detailed step-by-step instructions on how to make it work with "/dev/shm/zero"? Don't assume everyone knows how to set the proper permissions/ownership. :) Thanks!

Share This Page