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?