LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > optimal opcode setup for large shared hosting plesk server

Reply
 
Thread Tools Display Modes
  #1  
Old 11-02-2010, 10:20 PM
strebel strebel is offline
Member
 
Join Date: Nov 2010
Posts: 13
Default optimal opcode setup for large shared hosting plesk server

Hey there,
Looking for suggestions on how best to configure the moving parts to take the most advantage of litespeed and an opcode cache. We need to maintain security but want to maximize performance and reduce cpu load.

Background:
- Litespeed Web Server Enterprise v4.0.17
-- LSAPI in suExec as lsphp5
- Plesk 9.5.3
- Currently eAccel complied thru LS

Our #1 priority is security hence the suExec, but performance is a very close #2

Plesk has a toggle for the domain settings to run as Apache, FastCGI, or CGI. We leave it on FastCGI or CGI to spawn the php process as the file owner so it has write permissions without needing 777.

We are looking for the best way to implement an opcode, APC, eAccell or what have you. So my specific questions knowing that we need to keep suExec and plesk are:
  1. Which opcode works best?
  2. What are the ideal config settings for the opcode?
  3. Allocate 1mb, 10mb or even 10gb of ram for it?
  4. Is the ram allocated on a per vhosts basis or server wide? How is it utilized?
  5. Does the opcode reset when the suExec php process terminates? Is there any way around it?
  6. Anything we can do in plesk to achieve a better setup?

Some LS specific questions:
  • What are the ideal settings for LSAPI for ram/process on very large shared host? Over 800 vhosts
  • Max children?
  • Max connections? etc.

Last edited by strebel; 11-02-2010 at 10:23 PM..
Reply With Quote
  #2  
Old 11-02-2010, 11:30 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
in your case, please try eAccelerator and monitor the result.
settings:
Quote:
eaccelerator.shm_size="1"
eaccelerator.cache_dir="/dev/shm/ea"
eaccelerator.enable="1"
the idea is to use opcode cache on disk - only eAccelerator provide on disk cache. only give 1M memory cache. but the disk actually in shared memory area.

note:
1.need create /dev/shm/ea folder first, and set permission 777
2.create a cron job to cleanup /dev/shm/ea.

your case is shared hosting, php suExec enabled.
Reply With Quote
  #3  
Old 11-02-2010, 11:45 PM
strebel strebel is offline
Member
 
Join Date: Nov 2010
Posts: 13
is 1M kinda meh?

WordPress will if allowed fill 20-32mb of opcode cache on a single page load.

Is 1M for each 800 domains (800mb total ram used for cache) better than nothing i guess?
Reply With Quote
  #4  
Old 11-02-2010, 11:59 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
set to 1M --- because can't set lower than 1M. if eAccelerator has a option to disable in memory opcode cache, then let's use it.

in php suExec mode, php process will start/stop frequently. in-memory cache will disappear with the terminated php process. while cache in disk remains there and can be re-used by future php process. eAccelerator will look for in-memory opcode cache first, if not found(since only give it 1M cache), it look for cache on disk.
Reply With Quote
  #5  
Old 11-03-2010, 12:19 AM
strebel strebel is offline
Member
 
Join Date: Nov 2010
Posts: 13
So are you saying over time that the disk cache will accumulate and grow for each vhost?
Reply With Quote
  #6  
Old 11-03-2010, 12:52 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
since the disk cache actually in memory(in our setting), so it's safe to check it regularly, to prevent it fill up the memory. eAccelerator don't clean up the on-disk cache, so you have to take care of it.
Reply With Quote
  #7  
Old 11-03-2010, 12:58 AM
strebel strebel is offline
Member
 
Join Date: Nov 2010
Posts: 13
So this is the best scenario then?

Enable 1M eAccell system wide, which will essentially force a write to disk as 1M fills up fast.

And periodically clean out the disk cache. how often?
We have over 800 domains on this box.
Reply With Quote
  #8  
Old 11-03-2010, 01:18 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
you've to watch and decide how often you should clean up the cache.

du -sh /dev/shm/ea

show how many space used.
Reply With Quote
  #9  
Old 11-06-2010, 01:35 PM
strebel strebel is offline
Member
 
Join Date: Nov 2010
Posts: 13
Simple cron to rm -rf /dev/shm/ea/* every couple hours?
Reply With Quote
  #10  
Old 11-06-2010, 07:04 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
should be ok.

or only delete files created some time ago(1 day, 8 hours or 2 hours etc)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:15 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.