perf(core): eliminate PHP session file lock contention on API/metrics, tune PHP-FPM pool, and remove redundant Keepalived restarts on sync

This commit is contained in:
sorcier committed 2026-11-05 23:46:02 +01:00
1 parent 0b654c885c
commit c93b52d99c
3 files changed
+35 -14

No files matched your search

+8 -4
View File
@@ -564,13 +564,14 @@ class ClusterManager
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonPayload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Expect:', // Désactive l'en-tête Expect: 100-continue pour éviter les blocages intermédiaires
'X-Nexus-Cluster-Signature: ' . $signature,
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$response = curl_exec($ch);
$httpCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
@@ -754,9 +755,12 @@ class ClusterManager
shell_exec('/usr/sbin/asterisk -rx "pjsip send unregister *" 2>/dev/null || true');
}
// Si le cluster est actif, actualiser le service Keepalived
// Si le cluster est activé mais que Keepalived n'est pas encore démarré, le démarrer
if (!empty($localClusterSettings['enabled'])) {
$this->applyKeepalivedConfig();
$keepalivedRunning = trim((string)shell_exec('pidof keepalived 2>/dev/null')) !== '';
if (!$keepalivedRunning) {
$this->applyKeepalivedConfig();
}
}
return [