1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Using memcache via a socket file?

Discussion in 'XenForo Pre-Sales Questions' started by euantor, Jul 1, 2012.

  1. euantor

    euantor Well-Known Member

    I've today bought a second hand license and am just waiting for it to be transferred. I decided to just ask my questions now rather than waiting though as this site seems most active during the night and when I'm at work.

    Anyway, what I want to know is whether XenForo allows the use of memcache as a data cache via a socket file? I've had a look at the docs but I couldn't see any mention of it. I also own an IPB license and I know for a fact they don't support socket files.
     
  2. Slavik

    Slavik XenForo Moderator Staff Member

    In theory it should work, you would just need to write up the relevent code and add it to your config.php to pass the information on.

    The question is, why would you want to do it in such a way?
     
  3. euantor

    euantor Well-Known Member

    Because I'm on webfaction's shared hosting and the only way I can use caching is by using memcache via a socket or by compiling PHP and everything for a single app - not something I much feel like doing.

    EDIT: Just found a guide to installing APC on a PHP 5.3 instance on webfaction. I generally prefer APC so I might see if it'll work. On another note, how well does XF play with PHP 5.4?
     
  4. Slavik

    Slavik XenForo Moderator Staff Member

    What a strange way of doing things?

    Well like I said, in theory, you should be able to add the code you need to pass it onto the socket file into the config.php file...

    Don't know if anyone has done that though.
     
    euantor likes this.
  5. euantor

    euantor Well-Known Member

    Sure is odd, but the rest of the service is great and means I don't have to worry about security and stuff like I did on my VPS. I guess I'll have a try and see what happens once my transfer is complete. Thanks for the help!
     
  6. digitalpoint

    digitalpoint Well-Known Member

    Memcache shouldn't be used in a single web server setup... It will be slower than using APC or XCache... Memcache is used for multi-server setups (since you are asking about a socket file to connect, I assume it's a single server setup).
     
  7. euantor

    euantor Well-Known Member

    It is a single server, yes. I never knew about that, I've been using it for a while on other systems too. Thanks for the information.
     
  8. euantor

    euantor Well-Known Member

    Following digitalpoint's comment, I have now successfully managed to compile APC into my PHP 5.4 install so all is good. No need for memcache any more :)
     
  9. digitalpoint

    digitalpoint Well-Known Member

    If you didn't have an opcode cacher already installed, you will see a massive speed up just from having APC installed (just as an opcode cacher, not even for storing variables).
     
  10. euantor

    euantor Well-Known Member

    There was no opcode caching in place as far as I could see. I installed it for all my PHP 5.4 apps on the server (currently an IPB install which is to be converted to xF once my license is transferred) and did notice a pretty significant speed increase. I then set it as the actual variable cache too and there was an even bigger gain. I've never used APC before so I'm pretty surprised at how easy it was to setup.
     
  11. Steve10

    Steve10 Well-Known Member

    Our host installed APC for us recently and I think loading time went down to about 1/3 of what we were experiencing before, so it's definitely worth it. :)
     
  12. digitalpoint

    digitalpoint Well-Known Member

    Yeah, if you don't have an opcode cacher installed... well... I don't even know what to say. Because you should. SUCH a massive waste of CPU resources to not.
     
  13. Anthony Parsons

    Anthony Parsons Well-Known Member

    What is the best solution for a cache with XF? I ask as I'm just about to change over to a ServInt dedicated server, and figure this may not be default installed.

    Which is better? APC or Xcache?
     
  14. digitalpoint

    digitalpoint Well-Known Member

    They are both about the same... I'd probably use APC just because it's maintained by PHP developers and it's being rolled into the main branch of PHP to become a built-in feature soon.
     
    Anthony Parsons likes this.

Share This Page