optimal opcode setup for large shared hosting plesk server

#1
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:

NiteWave

Administrator
#2
in your case, please try eAccelerator and monitor the result.
settings:
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.
 
#3
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?
 

NiteWave

Administrator
#4
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.
 

NiteWave

Administrator
#6
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.
 
#7
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.
 
#11
This is no good on a large server with hundreds of vhosts.

/dev/shm/ea fills up in about a minute. Interrupts, Fork Rate, Load, and Disk I/O all go up and the node becomes unstable. 8cores and 11gb of ram on this machine.

Any other ideas on how to run a opcode with suExec affectively?
 
#14
yeah, network disk not recommended. We experienced very slow disk access when /tmp is NFS in a few customer's servers.
using local disk, maybe a dedicated partition to store /tmp or for cache_dir only.
 
Top