Add a setting to limit max. simultaneous CLI PHP processes
Created by: ghost
Is you probably know I have problems on my largest hub with many CLI PHP processes running simultaneously. 150-200 processes are run daily around the same time, although that shifts over a longer time (right now it's around 9AM and 12AM (CEST). Because of this my VPS uses the maximum amount of memory at that time (3.9GB). The spike in memory usage and number of processes is only for 1-2 minutes.
As you also probably know I tried many different solutions, but whatever I do it doesn't help. I also disabled all federation add-ons, but after a few weeks the problems described in the first paragraph returned. I have more services running on my VPS and this works without only problems, except when Hubzilla wants everything for itself. I waited for version 2.8, to see if things improved, but I see no difference.
So my question is if it's possible to limit the maximum number of CLI PHP processes Hubzilla runs simultaneously? So administrators can guarantee Hubzilla doesn't slow down or kills the server.
Here is an example of the processes I am talking about (output of top sorted on memory usage):
12371 www-data 20 0 350932 18924 5412 S 0,0 0,5 0:00.12 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 12d1593e273943fe0295ec9f335ff941009eecd72678119e19cc665aa8674784
12330 www-data 20 0 350932 18904 5468 S 0,0 0,5 0:00.13 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 401cc506a8598693b9baf379caad65c8be718dd44d4e7fa587bb56d5191966ca
12383 www-data 20 0 350932 18872 5368 S 0,0 0,5 0:00.10 /usr/bin/php Zotlabs/Daemon/Master.php Deliver df3b872be572f04692f0a86b257beecfa2749eed9fdc0e43ad05877b7061ab41
12334 www-data 20 0 350932 18856 5412 S 0,0 0,5 0:00.13 /usr/bin/php Zotlabs/Daemon/Master.php Deliver f06155986e3fbf83f8e85c981cfecd37f30d48aefbc038e888011fbe3c0c8913
12442 www-data 20 0 350932 18856 5436 S 0,0 0,5 0:00.17 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 755ae16d278bbaaf87228c08e1d33b8ab51946005afce31614b803b41ca6ccef
12455 www-data 20 0 350932 18808 5376 S 0,0 0,5 0:00.14 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 7b8d1d328d9a3a83736c987a0f43e617aa01ab389af801ca5d5e884a6ffd0577
12392 www-data 20 0 350932 18796 5292 S 0,0 0,5 0:00.12 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 082b147007c96e9760a292387abb0e88b46921626adaef01e6e95160a7d7b4a1
12343 www-data 20 0 350932 18704 5260 S 0,0 0,5 0:00.12 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 98e7f214c16cbef63f413ee421d3d535a1cd9f64642d808d5d5d560be981d517
12399 www-data 20 0 350932 18688 5172 S 0,0 0,5 0:00.09 /usr/bin/php Zotlabs/Daemon/Master.php Deliver f697c38812f504af729822adfcba5d31158ba4678535fd254eebfe667c163cc9
12393 www-data 20 0 350932 18660 5008 S 0,0 0,5 0:00.11 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 51a7a3edf5f7415fe5582cf03a31e9e27ba521ab9a88bdbc806889f0bcef0cac
12686 www-data 20 0 350932 18636 4980 S 0,0 0,5 0:00.17 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 9cae2be6e9090dba8955d41992f0919077f6bb66f218a802131989927598bd57
12601 www-data 20 0 350932 18272 4828 S 0,0 0,4 0:00.16 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 0740ab0b0c50ec6bb1a32b16871bdaa752a0ea61c929729b5fc9fa0350c83bd9
12679 www-data 20 0 350932 17812 4156 S 0,0 0,4 0:00.17 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 103def0ed8cce159a56d7d59585634790a7e5a1220ad8955c8e39d6be157048a
12321 www-data 20 0 350932 17692 3968 S 0,0 0,4 0:00.11 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 0b495ed9ed2d23e5a729d53227f922ec75cc94db1c38ec138ed99db2d2ccaedd
12462 www-data 20 0 350932 17476 4076 S 0,0 0,4 0:00.16 /usr/bin/php Zotlabs/Daemon/Master.php Deliver 356e27ae2522fa8ee02f325c5a65dcf65ee8207a81590128a5333dbcf419ab27
This continues to a max. of 178 Zotlabs/Daemon/Master.php
processes.