1
1
Fork 0

Quit when processlist is too long

This commit is contained in:
Michael Vogel 2016-06-03 23:10:23 +02:00
commit df337e57d1
3 changed files with 21 additions and 7 deletions

View file

@ -55,8 +55,14 @@ if(!$install) {
load_config('system');
$processlist = dbm::processlist();
if ($processlist != "")
logger("Processlist: ".$processlist, LOGGER_DEBUG);
if ($processlist["list"] != "") {
logger("Processes: ".$processlist["amount"]." - Processlist: ".$processlist["list"], LOGGER_DEBUG);
// More than 20 running database processes?
// The system is too busy, so quit.
if ($processlist["amount"] > 20)
system_unavailable();
}
$maxsysload_frontend = intval(get_config('system','maxloadavg_frontend'));
if($maxsysload_frontend < 1)