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

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?
 
Here's the response I got from my managed VPS guys:

I would like to suggest that running an opcode cache like APC in conjunction with LiteSpeed will likely have minimal benefit on the performance of your server. LiteSpeed is already configured "out of the box" for enhanced speed when running in conjunction with SuPHP. Especially, if you are planning on running many sites on this server, it would be more beneficial to keep LiteSpeed running with SuPHP, which wraps incoming PHP requests with the permissions of the user that owns the PHP files. This enhances the security of your system because a PHP security exploit cannot be propagated across the system using the permissions of a shared user, such as 'nobody'.

It is certainly possible to change to DSO mode via cPanel's Web Host Manager at any time, and, if you are planning on running a single site that you want to optimize for speed, you may find some benefit in running an opcode cache without incurring much risk in having a common user account or the headache of creating one in the first place.
 
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:
That's not quite right what they wrote there. You will defintly benefit from opcache/+data cache sine Litespeed doesn't coach 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).
Would I still be using suPHP handler, or would I be switching to a different php library?
 
Would I still be using suPHP handler, or would I be switching to a different php library?
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.
 
so, @Moshe1010 I should switch my DSO to using LSPHP and add xCache?
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).
 
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).

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

php_suEXEC.webp

Under Litespeed Web Server Configuration:

Litespeed_Interface.webp

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)
 
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.
 
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.
 
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.
 
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.

Hosting company got xcache up and running, but I'm still not sure about the litespeed auto-reboot every 2 hours setting.
 
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:
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:
Your host should solve it for you. Just need to reset user permissions for your entire home directory (or something at that sort).
 
Memcache with FastCGI is the way to go with LiteSpeed.
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:
Top Bottom