diff --git a/docs/reports/performance-report-2026-04-30.html b/docs/reports/performance-report-2026-04-30.html new file mode 100644 index 00000000..3b7b5753 --- /dev/null +++ b/docs/reports/performance-report-2026-04-30.html @@ -0,0 +1,645 @@ + + +
+ + +Migration OpenWrt → Debian · Optimisation ARM64
+30 avril 2026 · ESPRESSObin V7
+| Composant | +Spécification | +Contrainte | +
|---|---|---|
| Appareil | +GlobalScale ESPRESSObin V7 | +— | +
| CPU | +Marvell Armada 3720 (2× Cortex-A53 @ 1.2GHz) | +Dual-core seulement | +
| RAM | +1 GB DDR3 | +Critique — limite stricte | +
| Stockage | +eMMC 2.4 GB | +Espace limité | +
| Swap | +512 MB (zram recommandé) | +Compression active | +
| OS | +Debian 12 (Bookworm) ARM64 | +Kernel 6.1 LTS | +
+ Disponible : 584 Mi | Swap utilisé : 37 Mi / 511 Mi (7%) +
+| Service | +Port | +RSS | +% RAM | +Status | +
|---|---|---|---|---|
| secubox-hub | +8001 | +56 MB | +5.5% | +OK | +
| secubox-portal | +8003 | +50 MB | +4.9% | +OK | +
| eye-remote | +socket | +50 MB | +4.9% | +OK | +
| secubox-system | +8002 | +49 MB | +4.8% | +OK | +
| systemd-journald | +— | +39 MB | +3.8% | +ÉLEVÉ | +
| nginx (workers) | +80/443 | +28 MB | +2.6% | +OK | +
| haproxy | +— | +10 MB | +1.0% | +OK | +
| TOTAL Services Python | +— | +205 MB | +20.1% | +OK | +
| Endpoint | +Temps (ms) | +Objectif | +Status | +
|---|---|---|---|
/api/v1/hub/status |
+ 49 ms | +< 100 ms | +EXCELLENT | +
/api/v1/hub/monitoring |
+ 77 ms | +< 100 ms | +BON | +
/api/v1/system/metrics |
+ 187 ms | +< 500 ms | +OK | +
| P50 Latence | < 100 ms |
| P99 Latence | < 500 ms |
| RSS par service | < 50 MB |
| Total Python RSS | < 400 MB |
| Démarrage à froid | < 5 s |
| P50 Latence | < 50 ms |
| P99 Latence | < 200 ms |
| RSS par service | < 100 MB |
| Total Python RSS | < 1 GB |
| Démarrage à froid | < 3 s |
+ Disponible : 648 MB — suffisant pour les opérations normales. +
+| Action | +Espace Libéré | +
|---|---|
Rotation journaux systemd (journalctl --vacuum-size=50M) |
+ 128 MB | +
| Cache APT et listes | +79 MB | +
Documentation (/usr/share/doc) |
+ 52 MB | +
| Paquets inutilisés (X11, Qt, UI) | +~300 MB | +
| TOTAL | +~567 MB | +
+# /etc/systemd/system/secubox-*.service.d/memory.conf +[Service] +MemoryMax=60M +MemoryHigh=50M ++
+# Pattern 13 de PATTERNS.md
+async def _refresh_cache():
+ while True:
+ data = await _compute_stats()
+ _cache.update(data)
+ await asyncio.sleep(60)
+
+@app.on_event("startup")
+async def startup():
+ asyncio.create_task(_refresh_cache())
+
+ +# /etc/systemd/journald.conf +[Journal] +SystemMaxUse=50M +SystemMaxFileSize=10M +MaxRetentionSec=7day ++
asyncio.gather() pour les commandes CLI multiples :
+
+# Pattern 14 de PATTERNS.md
+decisions, alerts, metrics = await asyncio.gather(
+ run_cmd("cscli decisions list -o json"),
+ run_cmd("cscli alerts list -o json"),
+ run_cmd("cscli metrics -o json"),
+)
+
+ +# /etc/systemd/system/zram-swap.service +modprobe zram +echo lz4 > /sys/block/zram0/comp_algorithm +echo 512M > /sys/block/zram0/disksize +mkswap /dev/zram0 && swapon /dev/zram0 -p 100 ++
+# Latence API +./scripts/bench/api-latency.py --host localhost --requests 100 + +# Baseline mémoire +./scripts/bench/memory-baseline.sh --watch --interval 60 + +# Profiling CPU (sous charge) +./scripts/bench/cpu-profile.sh --service hub --duration 30 ++
+# /etc/cron.weekly/secubox-cleanup +#!/bin/bash +journalctl --vacuum-size=50M +apt-get clean +find /var/log -name '*.gz' -mtime +7 -delete ++
| Script | +Fonction | +Commande | +
|---|---|---|
api-latency.py |
+ Mesure latence P50/P95/P99 | +./api-latency.py --host IP --requests 100 |
+
memory-baseline.sh |
+ Suivi mémoire RSS/PSS/USS | +./memory-baseline.sh --watch |
+
startup-time.sh |
+ Temps de démarrage services | +./startup-time.sh --full |
+
cpu-profile.sh |
+ Flame graphs (py-spy) | +sudo ./cpu-profile.sh --service hub |
+
locustfile.py |
+ Tests de charge | +locust -f locustfile.py --host URL |
+
+ L'ESPRESSObin SecuBox-DEB répond aux objectifs de performance définis pour un + appareil ARM64 contraint. Les principaux indicateurs sont dans les seuils acceptables : +
++ Les optimisations recommandées permettront d'améliorer la robustesse et de préparer + le déploiement de services supplémentaires (CrowdSec, WireGuard, DPI). +
+