how to fix this error "increase LSAPI_CHILDREN"

Viewed 319

I use the python flask and received this error too much in my stderr.log in cpanel hosting server : [UID:1015][630244] Reached max children process limit: 6, extra: 2, current: 8, busy: 8, please increase LSAPI_CHILDREN. enter image description here

I called to my hosting server and they increase my PHP_LSAPI_CHILDREN to 100. But I still received this error and my website get error 503 too much and i think this is because of that error i said. what is your suggestion ؟

1 Answers

If you've increased the PHP_LSAPI_CHILDREN limit and you're still hitting it there are two primary causes:

  1. Your site is getting so much traffic that the limit needs to be raised further, but before raising the limit further your systems administrator (or hosting provider) would need to determine if the server has enough resources available to sustain the higher limit. If you check your access logs and you're not seeing an excessive number of requests for the site, then you are most likely experiencing the second potential cause below. A variation of this could also be that the site is experiencing an excessive number of requests due to a DoS attack of some sort, in which case you would need to address the DoS rather than increase the limit.
  2. Your site has a coding issue that is causing requests to take an excessive amount of time to complete. Because the requests are taking so long to complete they start to stack up and then exhaust the PHP_LSAPI_CHILDREN limit. One classic root cause is for a website script to make a request to an external server that is blocked by a firewall which causes the PHP/Python/etc process to hang while it waits for the connection to time out. Another common issue is an excessively long wait for a database query to complete. cPanel has a guide for enabling the MySQL Slow log if you suspect it could be a database query:

https://support.cpanel.net/hc/en-us/articles/360052538914-How-to-Enable-the-Slow-Query-Log-in-MySQL-or-MariaDB

Related