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

Should I use a Cache mechanism if my VPS uses LiteSpeed?

Discussion in 'Server Configuration and Hosting' started by dvsDave, Oct 3, 2013.

  1. dvsDave

    dvsDave Well-Known Member

    So my VPS is running LiteSpeed, should I setup the standard Zend Core caching or should I use a tool like APC?
     
  2. Tracy Perry

    Tracy Perry Well-Known Member

  3. dvsDave

    dvsDave Well-Known Member

    Thanks @Tracy Perry, I'll see if my managed VPS guys can get this correctly installed for me!
     
  4. dvsDave

    dvsDave Well-Known Member

    Here's the response I got from my managed VPS guys:

     
  5. Moshe1010

    Moshe1010 Well-Known Member

    That's not quite right what they wrote there. You will defintly benefit from opcache/+data cache sine Litespeed doesn't cache PHP pages. I would suggest xCache, which is supported by cPanel (v. 3.03).
    You can also cache sessions with it (if you have enough RAM).
     
    Last edited: Oct 3, 2013
  6. dvsDave

    dvsDave Well-Known Member

    Would I still be using suPHP handler, or would I be switching to a different php library?
     
  7. Moshe1010

    Moshe1010 Well-Known Member

    Since you're on a VPS environment, you don't need anything except LSPHP. xCache won't work with suPHP. If to be more accurate, suEXEC is faster, but has also potential problems with opcaches, so it's better to disable it under non shared hosting environment (VSP/Dedi). LSPHP is secure enough in a single user environment, so tell your host to stop with the BS.
     
  8. dvsDave

    dvsDave Well-Known Member

    so, @Moshe1010 I should switch my DSO to using LSPHP and add xCache?
     
  9. Tracy Perry

    Tracy Perry Well-Known Member

    Pretty sure that's what he was saying that LSPHP would be fine in a single user environment (which is what you have I'm sure). ;)
    xCache would just be some icing on the cake.
     
  10. Moshe1010

    Moshe1010 Well-Known Member

    If your are not on LSPHP already, then your host has not idea what he's/they're doing:
    LSWS uses its own LSPHP (LSAPI + PHP) to execute PHP requests. If you've been on DSO so far, then you missed the entire Litespeed performance boost (OK, not entire, but a major part of it).
     
  11. dvsDave

    dvsDave Well-Known Member

    Alright, looking at my WHM settings, under Service Configuration -> PHP and SuEXEC, I have the following settings

    php_suEXEC.PNG

    Under Litespeed Web Server Configuration:

    Litespeed_Interface.PNG

    I haven't seen any LSPHP references, but this is my first time working with LiteSpeed and I'm just sorta over my head. (Thanks for all of your help! I truly appreciate it)
     
  12. Moshe1010

    Moshe1010 Well-Known Member

    The first screen shot doesn't have any relation to Litespeed. This is Apache configurations and you don't care for them (unless you run Apache, but you have Litespeed, so you probably don't).
    The second print screen is Litespeed's control panel in WHM. Go to PHP SuEXEC PHP configuration and disable it.
    Then go to Admin Web Console In Litespeed's plugin, enter username/password (if you don't know it. ask from your host).
    Afterwards click on the top Actions --> Real Time Stats. Then, you will see on the bottom External Application. It should say "Type: LSAPI", and Name is usully "lsphp5".

    Then ask from your host to install xCache 3.0.3 or do it by yourself from EasyApache via WHM. Make sure EasyApache is installing Litespeed automatically after PHP installation. Everything here is under the assumption that you don't use PHP 5.5, which isn't compatible with xCache (yet. 5.5 is not ready for prime time in my opinion so it's better to avoid it). If your PHP isn't 5.4.20, then it's a good time to update it.

    Don't forget to ask for xCache control panel (protected with a password), and make sure that Litespeed doesn't restart every 2 hours because it does so for some reason by default and clears xCache.
     
    dvsDave likes this.
  13. dvsDave

    dvsDave Well-Known Member

    thanks for the walk-through. I'm going to figure out how to slog through this as soon as I get the user/pass for the litespeed control panel.
     
  14. dvsDave

    dvsDave Well-Known Member

    So, I disabled suEXEC and got into the litespeed control panel. Real-time stats shows lsphp5.

    Now running 5.4.20

    rebuilt easyapache with xcache, but I can't seem to figure out how to find or configure xCache control panel, and the settings on litespeed have atorestart on, but I don't see a setting for restarting every 2 hours anywhere.
     
  15. dvsDave

    dvsDave Well-Known Member

    Hosting company got xcache up and running, but I'm still not sure about the litespeed auto-reboot every 2 hours setting.
     
  16. Moshe1010

    Moshe1010 Well-Known Member

    Don't touch it if it ain't broken. Just follow up on the hits in xcache's panel and see if it clears up every couple of hours. If yes, then It should be addressed.
    Don't forget to change your config.php (add therexCach and cache sessions if your RAM is high enough based on your forum's size). Don't forget to set var_cache so it will be enough to cache PHP files. I made it 16MB/128MB.
    Don't forget to do graceful restart(Litespeed) at any change that is made in your php.ini if you want that to be updated.
     
    Last edited: Oct 4, 2013
  17. dvsDave

    dvsDave Well-Known Member

    ahh crap. So, after all of this, I went to remove a line of script from page_container_js and I'm getting a permission denied error, when I go to commit the change in the templating interface. I am guessing that the switch from suEXEC to standard LSAPI has changed the user that accesses the directories, but I'm at a loss as to how to resolve this issue.

    BTW, I truly appreciate all the help you guys have been giving me. Please, please let me know if I can return the favor.
     
    Last edited: Oct 4, 2013
  18. Moshe1010

    Moshe1010 Well-Known Member

    Your host should solve it for you. Just need to reset user permissions for your entire home directory (or something at that sort).
     
  19. The Forum Heroes

    The Forum Heroes Well-Known Member

    Memcache with FastCGI is the way to go with LiteSpeed.
     
  20. Moshe1010

    Moshe1010 Well-Known Member

    LSAPI PHP > FastCGI
    LiteSpeed will use LSAPI by default even if you use Apache (or as external app through LiteSpeed) + FCGI PHP.
    http://www.litespeedtech.com/support/forum/showpost.php?p=22930&postcount=6

    You can also run memcache with xCache (although I wouldn't recommend it). They are pretty much different, and with XF you would have more benefit with opcache thea variable cache (on a single server environment like a VPS):
    http://www.litespeedtech.com/support/forum/showpost.php?p=35268&postcount=4
     
    Last edited: Oct 5, 2013
    Alfa1 likes this.

Share This Page