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

Go Back   LiteSpeed Support Forums > External Applications > PHP > LiteSpeed + APC + SuEXEC + FastCGI

Reply
 
Thread Tools Display Modes
  #1  
Old 07-22-2010, 03:19 AM
philipm philipm is offline
New Member
 
Join Date: Jun 2010
Posts: 9
Default LiteSpeed + APC + SuEXEC + FastCGI

History:
We are running litespeed (currently standard for testing), Plesk 9.5, SuEXEC enabled in litespeed, APC isntalled and compiled into PHP, and FastCGI module in Plesk for PHP.

Issue:
APC seems to be dumping about every 30 seconds(I assume this is a default timeout for a PHP thread), this only seems to be happening when the FastCGI module is enabled in Plesk, when we switch the PHP mode to Apache module there are no issues.

What we have tried:
We have tried to use the article listed here: www [dot] brandonturner [dot] net/blog/2009/07/fastcgi_with_php_opcode_cache (setting up the external app as a FastCGI module) I continue to get 503 errors when I view the apc.php page, when I leave the script handler as a litespeed API module and I have no issues (other than the APC dumping)

What we need:
We need FastCGI, SuEXEC, and some sort of caching (preferably memcaching, we would LIKE APC).

Does anyone have any suggestions?
Reply With Quote
  #2  
Old 07-22-2010, 11:25 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
eAccelerator is recommended for LiteSpeed suEXEC PHP.
FastCGI is not as fast as our LSAPI PHP. LiteSpeed will use LSAPI by default even if you use Apache + FCGI PHP.
Reply With Quote
  #3  
Old 07-24-2010, 08:58 PM
philipm philipm is offline
New Member
 
Join Date: Jun 2010
Posts: 9
We have tried eAccelerator as well but the cache still appears to be clearing on a contant basis.

We don't care about the speed of FastCGI, we need it for its security concerns. We need to be able to keep the PHP processes locked to the user that started them for security reasons.
Reply With Quote
  #4  
Old 07-25-2010, 08:17 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
LSAPI PHP does the same in suEXEC mode.
Reply With Quote
  #5  
Old 07-25-2010, 08:25 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,287
store eAccelerator's opcode in /dev/shm.

/dev/shm is in memory.

whether php process is running or killed, the cache is there until OS reboot.

I helped 1 customer to implement it, and clear the cache every 2 hours, it's working, and reduce the server load a lot as expected.
Reply With Quote
  #6  
Old 07-25-2010, 08:27 PM
philipm philipm is offline
New Member
 
Join Date: Jun 2010
Posts: 9
Quote:
Originally Posted by NiteWave View Post
store eAccelerator's opcode in /dev/shm.

/dev/shm is in memory.

whether php process is running or killed, the cache is there until OS reboot.

I helped 1 customer to implement it, and clear the cache every 2 hours, it's working, and reduce the server load a lot as expected.
Thanks I will give that a try and see how it goes.
Reply With Quote
  #7  
Old 07-25-2010, 10:04 PM
philipm philipm is offline
New Member
 
Join Date: Jun 2010
Posts: 9
We now have it set up like you have stated. But the cache is clearing again when we have Plesk set like this: http cl.ly/78987e80e527b52ff326

When we have Plesk set as any other run as module it works fine but the php process appears to be started by www-data not by the user. I have the eAccelerator cache set to go to /dev/shm but that isn't helping at all. If I turn off PHP support in Plesk it still works but the php process is still started at www-data (that is what user LSWS is running as)

If there is any bit of the configuration that I can provide please let me know.
Reply With Quote
  #8  
Old 07-25-2010, 10:36 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,287
here's an example settings FYI:
Quote:
eaccelerator.shm_only="0"
eaccelerator.cache_dir="/dev/shm/ea"
of course need create /dev/shm/ea first. and
chmod -R 777 /dev/shm/ea

run a few php scripts, and check
"find /dev/shm/ea -type f"
or
"du -sh /dev/shm/ea"
to see if the number of files or size is increasing? then the opcode cache of eAccelerator is working fine.

Quote:
the cache is clearing again
yes. that's for shared memory(SHM) cache. the SHM cache will disappear when its associated php process terminates. but eAccelerator also store opcode cache on disk at the same time --- /dev/shm/ea in this case.

when another php process start, it'll look for opcode in /dev/shm/ea.
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 10:00 PM.



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