Quit when processlist is too long
This commit is contained in:
parent
4914e8826b
commit
df337e57d1
3 changed files with 21 additions and 7 deletions
10
index.php
10
index.php
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue