Increasing LSAPI_CHILDREN

semprot

Well-Known Member
#1
I get this error message in my stderr.log

2016-09-05 05:06:51.109 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.

Strange thing is my PHP_LSAPI_CHILDREN is 120.

Here is my environment config :
Code:
PHP_LSAPI_MAX_REQUESTS=5000
PHP_LSAPI_CHILDREN=120
LSAPI_AVOID_FORK=1
LSAPI_ALLOW_CORE_DUMP=1
What should i change now?
 

NiteWave

Administrator
#2
please show full content of
lsws web admin -> Server -> General -> Using Apache Configuration File
and
lsws web admin-> Server -> External App -> lsphp5
 

NiteWave

Administrator
#4
does the error message
2016-09-05 05:06:51.109 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
appear in stderr.log many times or just once ?

I'm not sure what this error message exactly mean. may need developer's answer based on above info.
 

mistwang

LiteSpeed Staff
#5
Server may double the limit to 240 for 2-CPU license.
So, you can increase PHP_LSAPI_CHILDREN if need.
But, you may want to check why got 1240 running PHP processes, is it true and normal?
 

semprot

Well-Known Member
#6
does the error message

appear in stderr.log many times or just once ?

I'm not sure what this error message exactly mean. may need developer's answer based on above info.
It appears about 1-2 times a week (randomly).
When it appears, lot of same error messages (around 300-350) in short interval, for example :

Code:
2016-09-05 05:06:17.807 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
2016-09-05 05:06:17.907 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
2016-09-05 05:06:18.008 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
2016-09-05 05:06:18.108 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
2016-09-05 05:06:18.208 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
2016-09-05 05:06:18.308 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
But, you may want to check why got 1240 running PHP processes, is it true and normal?
When i run "top", i never see more than ~30 php process.
 

semprot

Well-Known Member
#7
here some of my stderr.log

Code:
2016-09-05 05:06:17.807 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
2016-09-05 05:06:17.907 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
2016-09-05 05:06:18.008 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN
...
... (LOT OF SAME ERROR MESSAGES) ...
...
2016-09-05 05:06:51.094 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
2016-09-05 05:06:51.109 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
Here are some lines in "error_log" which were closely happened with the LSAPI_CHILDREN error :
Code:
2016-09-05 05:06:27.014 [NOTICE] [X.X.X.X:36262] No request delivery notification has been received from LSAPI process group [-1], possible run away process.
2016-09-05 05:06:27.014 [NOTICE] [X.X.X.X:36262] Max retries has been reached, 503!
2016-09-05 05:06:27.015 [NOTICE] [X.X.X.X:36262] oops! 503 Service Unavailable
2016-09-05 05:06:27.015 [NOTICE] [X.X.X.X:36262] Content len: 0, Request line: 'GET /xxx.php/xxx HTTP/1.1'
2016-09-05 05:06:28.021 [NOTICE] [xxx.7.52.1:57007] No request delivery notification has been received from LSAPI process group [-1], possible run away process.
2016-09-05 05:06:28.021 [NOTICE] [xxx.7.52.1:57007] Max retries has been reached, 503!
2016-09-05 05:06:28.021 [NOTICE] [X.97.194.10:49544] No request delivery notification has been received from LSAPI process group [-1], possible run away process.
2016-09-05 05:06:28.021 [NOTICE] [X.97.194.10:49544] Max retries has been reached, 503!
2016-09-05 05:06:28.021 [NOTICE] [X.X.244.97:26042] No request delivery notification has been received from LSAPI process group [-1], possible run away process.
2016-09-05 05:06:28.021 [NOTICE] [X.X.244.97:26042] Max retries has been reached, 503!
2016-09-05 05:06:28.021 [NOTICE] [X.158.167.69:55399] No request delivery notification has been received from LSAPI process group [-1], possible run away process.
2016-09-05 05:06:28.021 [NOTICE] [X.158.167.69:55399] Max retries has been reached, 503!
2016-09-05 05:06:28.022 [NOTICE] [xxx.7.52.1:57007] oops! 503 Service Unavailable
2016-09-05 05:06:28.022 [NOTICE] [xxx.7.52.1:57007] Content len: 0, Request line: 'GET /xxx.php/xxx HTTP/1.1'
2016-09-05 05:06:28.022 [NOTICE] [X.97.194.10:49544] oops! 503 Service Unavailable
2016-09-05 05:06:28.022 [NOTICE] [X.97.194.10:49544] Content len: 0, Request line: 'GET /xxx.php/xxx HTTP/1.1'
2016-09-05 05:06:28.022 [NOTICE] [X.X.244.97:26042] oops! 503 Service Unavailable
2016-09-05 05:06:28.022 [NOTICE] [X.X.244.97:26042] Content len: 0, Request line: 'GET /xxx.php/xxx HTTP/1.1'
2016-09-05 05:06:28.022 [NOTICE] [X.158.167.69:55399] oops! 503 Service Unavailable
2016-09-05 05:06:28.022 [NOTICE] [X.158.167.69:55399] Content len: 0, Request line: 'GET /xxx.php/xxx HTTP/1.1'
2016-09-05 05:06:29.005 [NOTICE] [X.253.157.2:51945] No request delivery notification has been received from LSAPI process group [-1], possible run away process.
2016-09-05 05:06:29.005 [NOTICE] [X.253.157.2:51945] Max retries has been reached, 503!
....
... (LOT OF SIMILAR ERROR MESSAGES) ...
....
2016-09-05 05:09:32.030 [NOTICE] [Child: 84457] Shut down successfully!
2016-09-05 05:09:32.040 [NOTICE] [AutoRestarter] cleanup children processes and unix sockets of process with pid=84457 !
2016-09-05 05:09:32.040 [NOTICE] [AutoRestarter] child process with pid=84457 exited with status=0!
2016-09-05 05:09:32.041 [NOTICE] [lshttpd:84433] Server Stopped!
2016-09-05 05:17:03.014 [NOTICE] [AutoUpdate] Checking for new releases..., pid=38006
2016-09-05 05:17:03.309 [NOTICE] Start to clean up cache directory, pid=38007
2016-09-05 05:35:48.001 [NOTICE] Memory size is: 264415124KB.
2016-09-05 05:35:49.099 [NOTICE] [OK] Updated license key has been created at /usr/local/lsws/c
 

NiteWave

Administrator
#8
It appears about 1-2 times a week (randomly).
When it appears, lot of same error messages (around 300-350) in short interval, for example :
got it, have an idea about its frequency. after those messages, did lsws restart itself ?

for those messages in error_log, you can ignore them since all are [NOTICE].
 

semprot

Well-Known Member
#9
got it, have an idea about its frequency. after those messages, did lsws restart itself ?

for those messages in error_log, you can ignore them since all are [NOTICE].
Yes, i remember i received some emails about lsws restarted by itself randomly (about 1-2x a week).

But i didn't pay attention to the email time, whether it happened close by the STDERR message or not.
 

semprot

Well-Known Member
#11
you can check /usr/local/lsws/logs/lsrestart.log, and see if time stamp match.
Interesting. I've never known that log exists.
I have deleted the email, so i will wait until i receive another email.
When i receive the email again, should i check between lsrestart.log + stderr.log + error_log ?
 

NiteWave

Administrator
#12
2016-09-05 05:06:51.109 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
the time stamp is 2016-09-05 05:06:51.109
base on it, you can check /usr/local/lsws/logs/lsrestart.log, extract a few log entries around that time (before and after)
 

semprot

Well-Known Member
#14
Ok so i received this email at September 19th 2016, 09:07 UTC :

Code:
LiteSpeed Web server xxxx.com on xxxx.com restarts automatically to fix 503 Errors
This is my stderr.log :
Code:
2016-09-19 09:06:19.201 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
2016-09-19 09:06:19.301 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
......
2016-09-19 09:06:43.079 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
2016-09-19 09:06:43.098 [STDERR] Reached max children process limit: 240, extra: 1000, current: 1240, please increase LSAPI_CHILDREN.
Latest lines in my lsrestart.log :
Code:
.....
Fri Sep 16 22:01:01 UTC 2016
restart, LSWS running: 1
Sat Sep 17 22:01:01 UTC 2016
restart, LSWS running: 1
Sun Sep 18 22:01:01 UTC 2016
restart, LSWS running: 1
Some interesting lines from my apache error_log :
Code:
2016-09-19 09:06:37.087 [NOTICE] [xxx.125.174.29:51772] No request delivery notification has been received from LSAPI process group [-1], possible run away process.
2016-09-19 09:06:37.087 [NOTICE] [xxx.125.174.29:51772] Max retries has been reached, 503!
2016-09-19 09:06:37.087 [NOTICE] [xxx.162.244.115:25605] No request delivery notification has been received from LSAPI process group [-1], possible run away process.
2016-09-19 09:06:37.087 [NOTICE] [xxx.162.244.115:25605] Max retries has been reached, 503!
2016-09-19 09:06:37.088 [NOTICE] [xxx.125.174.29:51772] oops! 503 Service Unavailable
2016-09-19 09:06:37.088 [NOTICE] [xxx.125.174.29:51772] Content len: 0, Request line: 'GET
 

mistwang

LiteSpeed Staff
#15
Are you using LSPHP daemon mode? Which version of PHP LiteSpeed SAPI are you using?
maybe the process count is not accurate and grow steadily over time, if there is not that many PHP process actually running.
Usually, the counter reset once server restarts.

Maybe we should login the server to take a look.
 

semprot

Well-Known Member
#16
Are you using LSPHP daemon mode? Which version of PHP LiteSpeed SAPI are you using?
maybe the process count is not accurate and grow steadily over time, if there is not that many PHP process actually running.
Usually, the counter reset once server restarts.

Maybe we should login the server to take a look.
On my :
External App > php5 > Run On Start Up : suEXEC Daemon (i have not changed it for > 3 years)

I use lsphp5, php version 5.6.25.

Should i PM you the litespeed admin user credential?
 

Hedloff

Well-Known Member
#17
Did you find a solution for this?

I just saw this in stderr.log myself:

2016-11-23 22:42:49.006 [STDERR] Reached max children process limit: 10, extra: 3, current: 13, please increase LSAPI_CHILDREN.
2016-11-23 22:42:49.027 [STDERR] Reached max children process limit: 10, extra: 3, current: 13, please increase LSAPI_CHILDREN.

In Enviroment I have setup 35:
PHP_LSAPI_CHILDREN=35

Why does it say limit on 10? Where can I change this and the extra?

See my settings:
 

Attachments

Last edited:
#19
Why does it say limit on 10? Where can I change this and the extra?
please try to change "PHP suEXEC Max Conn" in your attached children2-png

I think in this environment, here "Max Conn" will override PHP_LSAPI_CHILDREN in children-png, or it's PHP_LSAPI_CHILDREN in this context.
 
Top