WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3 Total Cache] xCache Support (30 posts)

  1. ABFInteractive
    Member
    Posted 4 years ago #

    Hi,

    Is there a reason APC is the only supported OPCode cache? I, along with many people, prefer to use xCache and would love to see xCache support built in.

    Thank you.

  2. Frederick Townes
    Member
    Posted 4 years ago #

    The reason is stability. Also on the operating systems tested, APC was faster (for WordPress) by a small percentage. Furthermore APC will be part of PHP6 making the need for other opcode cache's quite a moot point.

  3. ABFInteractive
    Member
    Posted 4 years ago #

    APC leaves a lot to be desired such as a basic way to turn it off via .htaccess. I don't need things I rarely use and get no traffic to (such as phpmyadmin or other tools that I only use) to be cached, ever. xCache easily gives you the ability to exclude these via a php flag in an .htaccess file.

    I'm not sure what you mean by stability either. It's just as stable as APC.

  4. Frederick Townes
    Member
    Posted 4 years ago #

    Mileage varies as do preferences, my comments are based on my research, experience and very large WordPress deployments. I'm not really interested in debates about opcode caches, use whatever you prefer.

  5. Gilligan
    Member
    Posted 3 years ago #

    Xcache is obviously now supported, but I thought I'd add some info. I have found that in my environment (Virtualmin on CentOS with Xcache, PHP running as user in FCGID), what works best is to use Xcache for the database and object cache, and disk for the minify and page cache.

    This is because Xcache does not really support much administration (flush) except when running mod_php as user apache. I burned a lot of time trying to get it to work to run xcache for all caches, which is very very fast, but the need to constantly flush the page and minify caches was difficult, especially when lots of admin area users are involved.

    You won't see the FCGID processes in the Xcache admin pages, but believe me the database and object stuff does get cached although it does not show up. I have similar experience with Joomla in the same environment and xcache does indeed cache the db queries and objects.

  6. @PlayGod

    Agreed except that I have found better performance using Xcache for minify over disk.

    I am running PHP as Apache (DSO) with disk enhanced for page caching and Xcache for minify, database and object and getting fantastic results.

  7. Gilligan
    Member
    Posted 3 years ago #

    c3m, Yes Xcache is fully functional only if you run PHP as apache. I haven't found a way to get w3tc's admin tasks (empty cache) to work running FCGID, that's why I'm running minify via disk. I have xcache-admin setup properly and can access the admin, but w3tc's login prompt does not work -- on my server xcache requires https to log into the xcache admin; perhaps if I can modify the plugin to run the empty requests as https, it will work.

    I do run other sites on my server as apache with mod_php, however the tradeoffs in convenience and security are not worth it with WordPress, IMO -- having to change permissions on upload directories for auto-updates and installs is a hassle.

    I'm thinking of removing Xcache and installing APC instead, since it will likely be better supported.

    Nonetheless, I am very impressed by the performance gains and ease of use with this plugin. Here's hoping switching to APC will solve my admin issues and allow me to cache more in memory vs disk.

  8. John Robertson
    Member
    Posted 3 years ago #

    APC and Xcache have proven to be pretty comparable in terms of benchmarking, sometimes with Xcache beating APC, but it proves to be more unstable than APC, so results may fluctuate here and there. APC is the best alternative as Frederick said... due to PHP6 support. However, Ive been seeing that APC and specific modules like suphp can actually cause a decrease in performance. a better setup would be using php-fpm or php-fcgi with APC.

  9. Frederick Townes
    Member
    Posted 3 years ago #

    I have xcache-admin setup properly and can access the admin, but w3tc's login prompt does not work

    That's not what's happening. When admin password for xcache cache is empty, there will be a prompt when trying to empty cache. That's how xcache works, it has nothing to do with W3TC.

  10. Gilligan
    Member
    Posted 3 years ago #

    Thanks braddor, I've since switched to APC for my server and all is running well.

    Frederick, APC is working better than xcache. Thanks for this plugin!

  11. Frederick Townes
    Member
    Posted 3 years ago #

    Welcome.

  12. mikanett
    Member
    Posted 3 years ago #

    very useful topic! thanks all!

    my wordpress blog has 8k visitors/day, 100-200 online at the same time

    after reading this topic, i uninstall xcache and install APC

    so now i need to change all from xcache to apc right, is it better?

  13. Frederick Townes
    Member
    Posted 3 years ago #

    If you have a single server, use disk enhanced for page cache, disk for minify and you can try APC for object cache and database cache and see if those improve performance for your case.

  14. Gravitydk
    Member
    Posted 3 years ago #

    I found W3 Total Cache asking me for the xcache Administration password, too, but even if I entered it correctly, it was not accepted. Most odd.
    It did seem related to minify and page cache too. I have not isolated it yet, though.

    I'm using CGI as the PHP Handler (not DSO, not FCGI); I think this is part of the problem. I can't clear the W3 Total Cache, because xcache administration wants me to authenticate, and when I put in the credentials, it doesn't seem to make any difference.

  15. @Gravitydk The xcache admin username and password are required for W3 to clear the cache. Make sure you are using a md5 hash string for your password in the xcache.ini.

  16. Frederick Townes
    Member
    Posted 3 years ago #

    @c3mdigital is correct, this has nothing to do with W3TC itself actually. BTW, I think there is a directive to disable the need for administrative authentication for xcache.

  17. I believe you can set xcache.admin.enable_auth to "off" in the .ini

    Here is what XCache says about it:
    xcache.admin.enable_auth string
    Disable XCache builtin http authentication if you plan on handling authentication yourself. Be aware that any vhost users can set up admin page, if builtin http auth is disabled, they can access the page with out any authentication. So it is suggested that you disable mod_auth for XCache admin pages instead of disabling XCache builtin auth. This option is 1.2.x only since 1.2.1

  18. Gravitydk
    Member
    Posted 3 years ago #

    Thanks.
    I also found in the W3TC "install" page, within WordPress, a path to a pre-written xcache.ini file for /etc/php.d/ which I hadn't seen before. It includes the user/pass pair we're discussing.

    I've put that file into that directory, after uncommenting these lines, and putting my password in using its hashed form:

    ;xcache.admin.user = "admin"
    ;xcache.admin.pass	= "hash-password-here"
    ;xcache.admin.enable_auth = On

    Restarted Apache.
    However, W3TC still asks for a name/password.

    I have left the first few lines as-is from the W3TC-provided ini, because I don't understand them. I have loaded xcache directly rather than as a function of Zend.

    ; /etc/php.d/xcache.ini
    
    ;extension = xcache.so
    zend_extension = "/usr/lib/php/modules/xcache.so"
    zend_extension_ts = "/usr/lib/php/modules/xcache.so"

    Any suggestions?

  19. Frederick Townes
    Member
    Posted 3 years ago #

    First, those lines youv'e shown are commented out, second you can change xcache.admin.enable_auth = On to xcache.admin.enable_auth = Off if you uncomment it.

  20. Gravitydk
    Member
    Posted 3 years ago #

    Hi Frederick, my mistake, I pasted in the lines before I had removed the comment marker. When I tested it, those three lines user/pass/auth were uncommented.

    If they were uncommented in my environment (CentOS 5.4, 64-bit, Kernel version 2.6.18-164.11.1.el5, Apache version 2.2.16), does it otherwise look correct? Since I had the authentication request when I tried clearing cache, I figured there must have been something wrong in the ini file or its location.

    I didn't want to stop the authentication because I couldn't assess the risk that c3mdigital had outlined.

  21. Frederick Townes
    Member
    Posted 3 years ago #

    It does otherwise look correct. I'm personally not a fan of xcache, I only use it under special circumstances, so I don't have any further troubleshooting tips off the top of my head.

  22. Gravitydk
    Member
    Posted 3 years ago #

    Thanks for your help Frederick.

    FYI to others. I found that my xcache.ini file was not been loaded at all, because (I expect) my php.ini file had the xcache settings in it.
    I found the location of my php.ini file by checking a phpinfo.php page, looking for the line "Loaded Configuration File".

    Within it was, strangely, already a name/pass pair... most bizarre it isn't being recognised! Maybe the md5 is wrong.

  23. Frederick Townes
    Member
    Posted 3 years ago #

    Thanks for letting us know.

  24. mattjabs
    Member
    Posted 3 years ago #

    Does anyone know of a solid tutorial for installing xcache on a (dv) at mediatemple.net - or for CentOS in general?

    Thanks.

  25. mattjabs
    Member
    Posted 3 years ago #

    Please disregard that last question, I was able to install it successfully - it now shows as being installed on the compatibility check.

    That said, is there a "best config" for xcache/memcache for a dedicated virtual server setup?

    For example: What are the best settings for:

    Page Cache - disk, disk enhanced, xcache, or memcache?
    Minify - disk, xcache, or memcache?
    Database Cache - disk, xcache, or memcache?
    Object Cache - disk, xcache, or memcache?

    I'm sure it depends on a lot, but is there a "default best"?

    Thanks!

  26. @mattjabs,

    Generally disk enhanced always performs better for page cache. For minify I haven't been able to see much difference between disk, XCache or Memcache. For DB and Object I have gotten my best results using memcache.

    My suggestion is to test different combinations using Apache Bench. To run it: $ ab -n 1000 -c 10 http://example.com The number after -n sets the amount of requests and the -c is the concurrency level.

    I always restart Apache after each run and visit the page to rebuild the cache.

  27. mattjabs
    Member
    Posted 3 years ago #

    Great, thanks. That is also the config I settled on after some basic trial and error last night.

    Page = disk enhanced
    Minify = disk
    Database = memcache
    Object = memcache

    For the record, I'm running on a dedicated virtual server hosted with MediaTemple.net.

  28. Frederick Townes
    Member
    Posted 3 years ago #

    xcache should be faster than memcached in your case.

  29. Kitmitsu
    Member
    Posted 3 years ago #

    I've had the plugin running for just under two weeks now and I'm impressed with it. Thing is, I've had to switch from using xcache to disk because otherwise I'd have to tell my editors my xcache password. That isn't something I want to do really. I also definitely don't want to disable the auth process completely.

    I'm on a dedicated server and although I realise it's best to rely on disk enhanced for page caching, I'm pretty certain xcache is better for database and object caching. Is running database and object caching on disk going to cause a huge bottleneck compared to not caching them at all?

  30. Frederick Townes
    Member
    Posted 3 years ago #

    You can remove the need for authentication from xcache. Using opcode and opcode caching for database/object cache is a great performance win for high traffic sites with lots of comments or even a few.

Topic Closed

This topic has been closed to new replies.

About this Topic