80) { header('HTTP/1.1 503 Too busy, try again later'); die('Server too busy. Please try again later.');}*/// 建议最大负载不要超过3*N核,例如有16核(含8核超线程)则 16*3=48function get_server_load() { if (stristr(PHP_OS, 'win')) { $wmi = new COM("Winmgmts://"); $server = $wmi->execquery("SELECT LoadPercentage FROM Win32_Processor"); $cpu_num = 0; $load_total = 0; foreach($server as $cpu){ $cpu_num++; $load_total += $cpu->loadpercentage; } $load = round($load_total/$cpu_num); } else { $sys_load = sys_getloadavg(); $load = $sys_load[0]; } return (int) $load;}