The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Eaccelerator or xcache?

Discussion in 'Workarounds and Optimization' started by zenid, Apr 6, 2012.

  1. zenid

    zenid Well-Known Member

    Joined:
    Aug 22, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    I have running at this moment: Apache 2.2.22 with PHP 5.3.10 in Mod Ruid2 (before SuPHP, but Mod Ruid2 is a lot faster.)

    I have a lot of PHP website like Wordpress, Joomla, forums. I was wondering if it a good option is to run:
    Eaccelerator or xcache? or both?. Now i have both disabled
     
  2. Gene Steinberg

    Gene Steinberg Well-Known Member

    Joined:
    May 26, 2007
    Messages:
    157
    Likes Received:
    1
    Trophy Points:
    18
    Unless things have changed, I'd use the eAccelerator add-on with cPanel. The xCache installer failed to include most of the key options required for performance improvements. That is, unless they've changed it (and the EasyApache documentation doesn't seem to indicate such changes). So you're left with manually replacing an xCache configuration in php.ini yourself.
     
  3. johnburk

    johnburk Well-Known Member

    Joined:
    Jun 23, 2006
    Messages:
    241
    Likes Received:
    0
    Trophy Points:
    16
    xCache will not work or will not work correctly if you install it with Easyapache. My experience is that is does perform better than eacceleratoe, but you have to install it manually.
     
  4. Gene Steinberg

    Gene Steinberg Well-Known Member

    Joined:
    May 26, 2007
    Messages:
    157
    Likes Received:
    1
    Trophy Points:
    18
    Actually, the issue is mostly the preferences that have to be manually added and set. Then you should be OK, although eAccelerator is reasonably well configured with the cPanel install (except for needing to give the cache more memory). But I ended up with APC, because it was recommended for some of the commercial forum systems.
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If the xCache options aren't added and might be helpful, I would suggest adding a feature request to add options similar to what happens for eAccelerator:

    Feature Requests for cPanel/WHM
     
  6. johnburk

    johnburk Well-Known Member

    Joined:
    Jun 23, 2006
    Messages:
    241
    Likes Received:
    0
    Trophy Points:
    16
  7. jpearl

    jpearl Member

    Joined:
    Oct 28, 2011
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AZ
    cPanel Access Level:
    Root Administrator
    I did an easy write up on how to install and configure xcache on your server. The guy above is right about it not working correctly if installed with easy apache. I dont know if I am allowed to put up my link on here but pm me and I will give it to you.
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Rather than linking it, how about posting here how to do it? We rather have the details on the forum on how to actually do things. Links can expire or cease working, then the information is lost. Better to have it on the forum itself. Thanks!
     
  9. LittleB

    LittleB Member

    Joined:
    Apr 30, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Definitely interested in the correct procedure to install this as well.
     
    #9 LittleB, May 17, 2012
    Last edited: May 17, 2012
  10. -GR-

    -GR- Active Member

    Joined:
    May 2, 2012
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    It installs correctly but the default config settings in php.ini basically have xcache turned off. So you won't notice a difference unless you setup the configuration values.

    Code:
    ;extension="xcache.so"
    ;xcache.admin.enable_auth="on"
    ;xcache.admin.pass="******"
    ;xcache.admin.user="****"
    ;xcache.cacher="On"
    ;xcache.coredump_directory=""
    ;xcache.count="7"
    ;xcache.coveragedump_directory="/tmp/pcov/"
    ;xcache.coverager="Off"
    ;xcache.gc_interval="1800"
    ;xcache.mmap_path="/dev/zero"
    ;xcache.optimizer="On"
    ;xcache.readonly_protection="On"
    ;xcache.size="300M"
    ;xcache.slots="8K"
    ;xcache.test="Off"
    ;xcache.ttl="86400"
    ;xcache.var_count="1"
    ;xcache.var_gc_interval="300"
    ;xcache.var_maxttl="0"
    ;xcache.var_size="4M"
    ;xcache.var_slots="8K"
    ;xcache.var_ttl="0"
    
    A default install has the xcache.var_size and xcache.size set to 0 so it won't cache. Above is my config settings but I currently have xcache disabled (note the comments ; in front of each line) as I am doing some testing with APC to see which one I prefer.
     
  11. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    The default config has an error. Change this line: xcache.admin_enable_auth
    to:
    xcache.admin.enable_auth
    note the underscore is now a "dot"
     
  12. Fral-IT

    Fral-IT Member

    Joined:
    Jun 13, 2012
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks everyone so far, if there are more tips we'd sure like to hear them :)
     
  13. albatroz

    albatroz Well-Known Member

    Joined:
    Mar 6, 2003
    Messages:
    258
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Virtual Orbis / Peru
    cPanel Access Level:
    Root Administrator
    Do you have to enable eaccelerator on easyapache to enable xcache?

    Did you have any issues when changed from suPHP to dso/modruid2 ?
     
  14. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    EAccelerator and xCache are different options. Neither require the other. EAccelerator can be enabled by itself or xCache can be. The only requirement is that you are using DSO or FCGI. suPHP won't work with OPCode Caching Engines.
     
  15. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    how would I configure xchace on a shared hosting server, specifically to be used with Wordpress and possibly other applications?

    Let me be a bit more direct: Is it safe to give the "xcache.admin.pass=" & xcache.admin.user="****" valued to end users, which the pretty much defeats the purpose of having a username and password to begin with. Or, how does one configure it to still be secure?
     
  16. jpearl

    jpearl Member

    Joined:
    Oct 28, 2011
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AZ
    cPanel Access Level:
    Root Administrator
    I never posted it because it was so long. Thats why I linked it. Here it is. It might be a lil outdated but the process is the same.

    Configure Xcache on your linux server.

    Now that you have installed Xcache its time to configure it for your server. If you haven’t set it up yet then install Xcache first.

    You have the default config so I will show you what I use and why. Open your php.ini file and edit it.

    [xcache-common]

    zend_extension = “/usr/local/lib/php/extensions/no-debug-non-zts-20090626/xcache.so”
    zend_extension = “/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so”

    [xcache.admin]
    xcache.admin.enable_auth = Off <——- If you have problems logging into the admin, set to off.
    xcache.admin.user = “myname”
    ; xcache.admin.pass = md5($your_password)
    xcache.admin.pass = “md5ofwhateveryourpasswordis”

    [xcache]

    xcache.shm_scheme = “mmap”
    ; to disable: xcache.size=0
    ; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
    xcache.size = 256M <————-I have 4G of ram so I set it high.
    ; set to cpu count (cat /proc/cpuinfo |grep -c processor)
    xcache.count = 8 <———–I have 8 processors
    ; just a hash hints, you can always store count(items) > slots
    xcache.slots = 8K
    ; ttl of the cache item, 0=forever
    xcache.ttl = 3600 <———–this is seconds, set to 0 if you dont want it to ever get deleted.
    ; interval of gc scanning expired items, 0=no scan, other values is in seconds
    xcache.gc_interval = 300

    ; same as aboves but for variable cache
    xcache.var_size = 64M <———You dont have to set this.
    xcache.var_count = 8 <———–I have 8 processors
    xcache.var_slots = 8K
    ; default ttl
    xcache.var_ttl = 3600
    xcache.var_maxttl = 3600
    xcache.var_gc_interval = 300

    xcache.readonly_protection = Off
    xcache.mmap_path = “/dev/zero”

    ; make sure it’s writable by php (open_basedir is not checked)
    xcache.coredump_directory = “”

    xcache.cacher = On
    xcache.stat = On
    xcache.optimizer = Off

    xcache.test = Off
    xcache.experimental = Off

    xcache.coverager = Off

    xcache.coveragedump_directory = “”

    Restart apache when you are finished and look at a phpinfo.php file to verify that Xcache is working.

    /etc/init.d/httpd restart

    Admin panel setup

    If you followed my first tutorial, you have the source files in the /opt dir. Copy the whole admin folder in the xcache folder to one of your websites public_html folders.

    cp -Rf /opt/xcache-2.0.0 /home/your-user/public_html

    Change the ownership of the folder and files to your apache user or cpanel user and make them executable.

    chown -R user:user /home/your-user/public_html/admin

    chmod +x /home/your-user/public_html/admin

    You should now be able to go into your admin folder and see your cache being stored by the site.

    http://yoursite.com/admin

    It should look similar to this. http://xcache.lighttpd.net/demo/admin/
     

Share This Page