PHP LSAPI process limit ignored?

#1
I've had Litespeed up and running successfully on a 3 server web farm for a couple months now. The only real problem I haven't been able to correct on my own is how to properly limit the number of simultaneous PHP processes.

In my server config for the PHP external app I have:
Max Connections: 100
Environment: PHP_LSAPI_MAX_REQUESTS=50000
PHP_LSAPI_CHILDREN=100
LSAPI_MAX_IDLE_CHILDREN=30
Persistent: Yes
Auto Start: Yes
Instances: 1
Run On Start Up: Yes
Process Soft Limit: 100
Process Hard Limit: 150
However the real-time stats page shows Max CONN and Eff Max for the PHP external app as 800 and the server routinely has 120-150 lsphp processes even when only a few are being used. I searched the text of the various lsws config files and the number 800 isn't anywhere to be found in them.


The number of processes needs to be limited because of the connection limit at our master database server. The connection limit is currently 600 and I would really only expect 300 (100 x 3 servers) connections at any one time. When that server gets tied up with something I routinely get "max connections exceeded" errors from MySQL. That tells me the limits are being ignored or I've done something wrong.

Is there something wrong with my configuration?
 

mistwang

LiteSpeed Staff
#2
As each lshttpd will start its own group of lsphp processes, with 8-CPU license, the Max CONN will be 100 X 8, so if you want to have the real limit to be 200, You should set

Max Connections: 30
Environment:
PHP_LSAPI_CHILDREN=30

Process limit should be increase to something like
Process Soft Limit: 400
Process Hard Limit: 450
 
Top