No request delivery notification has been received from LSAPI application, possible dead lock.

#21
Many thanks for the reply. I will try.

100 processes seems like a lot for our box -8GB-. I was going to check free memory, then I guess I could roughly add at most free_memory/max_php_memory PHP_LSAPI_CHILDREN, but I don't know if there is more that needs to be taken into account, shared memory is mentioned on the documentation https://docs.litespeedtech.com/lsws/extapp/php/configuration/options/.

Additionally, I do not understand what "Max connections" settings means in External App configuration. I currently have the default of 10, but looking at admin console, seems like 100+ are being used:

Free SSL Conn: 19888
Https Used: 112
Max SSL Conn: 20000

This is a simple setup, 1 box, with 1 wordpress.
 
#22
I'm suffering of this issue now since months and tried so many things to no avail. I ditched Nginx and Apache for OLS due to its performance gains but this error is forcing me now to go back to Nginx.

I have PHP_LSAPI_CHILDREN=150 and LSAPI_AVOID_FORK=1 and played much with max_execution_time on PHP conf itself in hope that this will kill the spawn LSAPI children preventing them from growing to max but at some point just like others we will hit it..
 
#23
I think it's recommended to set Max Connections to the same value as PHP_LSAPI_CHILDREN.

There seems to be a huge variation in the best value for these variables, depending on the number of visitors, the type of sites hosted, the amount of available RAM and so on. In the absence of any guidance I suggest doubling these values every time you see a "possible dead lock" message and if you're lucky the problem will eventually go away.

If you're unlucky it will cause other problems first (which can be quite weird when you run out of memory) and you might have to increase the size of the server, which is expensive.
 

Cold-Egg

Administrator
#24
I agree with you, we will renew the OLS docs and hope it gets clearer. For the server log part, it's a little bit hard to modify especially when it's caused by OOM.
If it helps, I found that increasing PHP_LSAPI_CHILDREN did indeed eventually help. I had to increase it a LOT - it's currently at 100.

Be careful, though. There's a risk that increasing it too much will cause the server to run out of memory and crash. This happened to me three days in a row at 4am (UK time) and I lost a longstanding customer as a result. Doubling the resources of the server eventually fixed it (at considerable cost, of course).

Here't the thing though - I tested all this using sites like loadimpact.com before deploying the server. I found the maximum and minimum values of PHP_LSAPI_CHILDREN needed for a given number of simultanous visitors and scaled the whole thing with plenty of headroom. And looking at the access logs and resource graphs at the time of the crashes the resource usage (CPU, memory, bandwidth, disk) was never more than half the danger level.

We could really use some better guidance for setting OLS up in a reliable configuration and diagnosing it when things go wrong. The default values are clearly inadequate (especially PHP_LSAPI_CHILDREN) and the log files are hard to find and the messages are misleading.
 

Cold-Egg

Administrator
#25
I think it's recommended to set Max Connections to the same value as PHP_LSAPI_CHILDREN.

There seems to be a huge variation in the best value for these variables, depending on the number of visitors, the type of sites hosted, the amount of available RAM and so on. In the absence of any guidance I suggest doubling these values every time you see a "possible dead lock" message and if you're lucky the problem will eventually go away.

If you're unlucky it will cause other problems first (which can be quite weird when you run out of memory) and you might have to increase the size of the server, which is expensive.
Correct, either set Max Connections to the same value as PHP_LSAPI_CHILDREN or set PHP_LSAPI_CHILDREN lower than the Max Connections.
 
#26
Thank you all for the inputs! Two questions:

- do you know why max connections doesn't seem to match the connections I see on the web admin console?

Free SSL Conn: 19888
Https Used: 112
Max SSL Conn: 20000

- Is there any advice on how to estimate max children other than trying and monitoring memory? That seems like a good practice anyways, but is there a way to estimate hardware required based on child processes? is max_php_memory ok for that?
 

Cold-Egg

Administrator
#29
The HTTP/HTTPS connection feature is under the Server Configuration > Tuning, not PHP related. If you have the net-tools app installed on the server, you can also check the established connection with this command: "netstat -an | grep "443" | grep ESTA".
 
Top