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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Bug Reports > [solved] APC goes crazy under LSWS 4.1.10 & 4.1.11

Reply
 
Thread Tools Display Modes
  #11  
Old 03-01-2012, 12:43 PM
Rowlf Rowlf is offline
Member
 
Join Date: Jan 2010
Posts: 14
Quote:
Originally Posted by webizen View Post
lsphp5 is there running as ec2-user. is this shared hosting or dedicated environment (PHP suEXEC yes or no)? ls LSWS running as ec2-user?
PHP suEXEC is explicitly set to 'No' as was suggested in some other thread (I tried that before posting here).
Code:
ps -ef|grep litespeed
root     24425     1  0 11:51 ?        00:00:05 litespeed (lshttpd)
500      24427 24425  0 11:51 ?        00:00:15 litespeed (lshttpd)
ec2-user 24953 24927  0 20:36 pts/0    00:00:00 grep litespeed
Reply With Quote
  #12  
Old 03-01-2012, 12:53 PM
Rowlf Rowlf is offline
Member
 
Join Date: Jan 2010
Posts: 14
As far as I understand, lsphp5 is running as ec2-user because the vhosts are located in /home/ec2-user/ (follows Docroot UID). I've had this setup on the old Debian box for over four years and hadn't had a problem with APC before upgrading to LSWS 4.1.10 & 4.1.11.
Reply With Quote
  #13  
Old 03-01-2012, 08:32 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,295
Quote:
lsphp5 is running as ec2-user because the vhosts are located in /home/ec2-user/
this indicates suExec is enabled.
but also
Quote:
PHP suEXEC is explicitly set to 'No'
this should be impossible.

this is the issue -- why you set to No, but lsphp5 running as ec2-user.
Reply With Quote
  #14  
Old 03-02-2012, 02:39 AM
Rowlf Rowlf is offline
Member
 
Join Date: Jan 2010
Posts: 14
Quote:
Originally Posted by NiteWave View Post
this is the issue -- why you set to No, but lsphp5 running as ec2-user.
Just to make this clear - the PHP suExec Yes/No setting is under Configuration -> Server -> General -> Using Apache Configuration File, nowhere else, is that right? Is it a server-wide setting no matter what? If it was not set either way at the time I instantiated the problematic vhost, would this be inherited by the vhost somehow?

Either way, I think I'll need to reinstall everything and see if it makes a difference.
Reply With Quote
  #15  
Old 03-02-2012, 02:55 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,295
Quote:
nowhere else, is that right?
right.
what's the value of
Load Apache Configuration:Yes/No ?

if No, all other settings under "Using Apache Configuration File" will be ignored.
Reply With Quote
  #16  
Old 03-02-2012, 03:11 AM
Rowlf Rowlf is offline
Member
 
Join Date: Jan 2010
Posts: 14
Quote:
Originally Posted by NiteWave View Post
right.
what's the value of
Load Apache Configuration:Yes/No ?

if No, all other settings under "Using Apache Configuration File" will be ignored.
It was set to No which I believe is the default setting. I have set it to Yes and restarted the server - APC still empties cache every couple of minutes and lsphp5 still runs under ec2-user.

Now I've just SSH'd to the old Debian box to compare (it's running PHP 5.3.8 on LSWS 4.1.9) and "Load Apache Configuration" there is set to No, and PHP suEXEC is not defined as are the rest of the settings in that group. Yet lsphp processes are run by the litespeed user and APC works.

The only difference I could see is that the Debian install is running lsphp processes whereas the new AWS one is running lsphp5 ones.
Reply With Quote
  #17  
Old 03-02-2012, 12:44 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,390
lsphp and lsphp5 should be the same. the cause of your problem seems to be your lsphp5 runs as different user for each account (follows Docroot UID). APC requires lsphp5 run under same user (web server user). i.e. only dedicated hosting can take advantage of APC.
Reply With Quote
  #18  
Old 03-11-2012, 01:23 AM
Rowlf Rowlf is offline
Member
 
Join Date: Jan 2010
Posts: 14
So I wiped the entire thing and started from scratch, this time on a 64bit Amazon Linux image though. Installed the 4.1.11 Standard Edition of LSWS.

Once I compiled PHP 5.3.10, I changed the following in the Server config(External App, php5):
Max Idle Time to -1
also verified that Max Connections and PHP_LSAPI_CHILDREN match (both set to 100).

In Virtual Host Templates -> PHP_SuEXEC -> Security, I noticed that "ExtApp Set UID Mode" was by default set to "DocRoot UID". I changed it to "Server UID", then added a test vhost, instantiated it and changed Max Idle Time for the vhost itself to -1.

This is what I got with one vhost working:
Code:
pstree -p | cat

        |-litespeed(2455)-+-httpd(2456)
        |                 `-litespeed(2457)-+-lsphp5(2520)
        |                                   |-lsphp5(2522)
        |                                   `-lsphp5(2523)
Code:
ps -ef | grep lsphp

500       2520  2457  0 08:09 ?        00:00:00 lsphp5
500       2522  2457  0 08:09 ?        00:00:00 lsphp5
500       2523  2457  1 08:09 ?        00:00:01 lsphp5
ec2-user  2556  1642  0 08:11 pts/0    00:00:00 grep lsphp
So it looks like it now spawns PHP processes as the web server user (litespeed - uid 500). However they appear to be independent, there are no child processes.

Refreshing the APC test page showed that too - APC accumulates cache for each of those three separate processes, so if I refresh the page, I see that one of the processes has accumulated a few MB of files from the test site, and the other one has nearly similar uptime (say 8 minutes) but has only the test apc.php file in the cache.

Experimenting further, I selected "Run on startup" = Yes, Max Connections = 1 and Instances = 1. Then I got the one and only PHP process working with APC:
Code:
        |-litespeed(2563)-+-httpd(2564)
        |                 `-litespeed(2565)-+-admin_php(2655)
        |                                   `-lsphp5(2632)

ps -ef | grep lsphp
500       2632  2565  0 08:14 ?        00:00:01 lsphp5
ec2-user  2659  1642  0 08:17 pts/0    00:00:00 grep lsphp
But I'm not sure what the repercussions are of limiting the amount of PHP processes per vhost to 1?

Any ideas why the child processes are not being spawned at all?
Reply With Quote
  #19  
Old 03-11-2012, 05:20 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,295
Quote:
Any ideas why the child processes are not being spawned at all
because you set "Max Connections = 1"

try:
Max Connections = 5
Env PHP_LSAPI_CHILDREN=5

keep
Instances = 1
Reply With Quote
  #20  
Old 03-11-2012, 05:12 PM
Rowlf Rowlf is offline
Member
 
Join Date: Jan 2010
Posts: 14
Quote:
Originally Posted by NiteWave View Post
because you set "Max Connections = 1"

try:
Max Connections = 5
Env PHP_LSAPI_CHILDREN=5

keep
Instances = 1
Thank you so much, that fixed it!

Code:
        |-litespeed(2606)-+-httpd(2607)
        |                 `-litespeed(2608)---lsphp5(2668)-+-lsphp5(2670)
        |                                                  |-lsphp5(2671)
        |                                                  `-lsphp5(2672)


ps -ef | grep lsphp
500       2668  2608  0 23:58 ?        00:00:00 lsphp5
500       2670  2668  0 23:58 ?        00:00:00 lsphp5
500       2671  2668  0 23:58 ?        00:00:00 lsphp5
500       2672  2668  0 23:58 ?        00:00:00 lsphp5
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 03:32 PM.



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