docs: add resource limits guide for low-RAM devices

- README: new section explaining WG_MEM_LIMIT / WG_MEMSWAP_LIMIT with
  per-RAM-tier values and host swap configuration for SBC boards
- CLAUDE.md: simplify resource limits table, drop device-specific
  measurements, reference README for per-board guidance
- .env.example: update comments with per-tier values and OOM warning

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-07 08:22:43 +02:00
parent 4d8eb01e4c
commit fc5d6209c1
3 changed files with 41 additions and 9 deletions
+26
View File
@@ -75,6 +75,32 @@ vpn/
---
## Dispositivi a risorse limitate (SBC)
Su board con poca RAM (≤ 1 GB) il processo Node.js di wg-easy può crescere nel tempo e far sì che il kernel OOM-killi altri processi di sistema — SSH compreso. Per evitarlo, decommenta e adatta questi valori nel tuo `.env`:
```ini
# Board con 512 MB RAM
WG_MEM_LIMIT=96m
WG_MEMSWAP_LIMIT=96m
# Board con 1 GB RAM
WG_MEM_LIMIT=128m
WG_MEMSWAP_LIMIT=128m
```
Tieni `WG_MEMSWAP_LIMIT` uguale a `WG_MEM_LIMIT` per disabilitare lo swap del container: quando il container raggiunge il limite viene riavviato da Docker invece di consumare swap di sistema.
Assicurati anche che lo swap dell'host sia almeno 512 MB. Su Raspberry Pi OS il default è 100 MB — per aumentarlo:
```bash
sudo dphys-swapfile swapoff
sudo sed -i 's/CONF_SWAPSIZE=100/CONF_SWAPSIZE=512/' /etc/dphys-swapfile
sudo dphys-swapfile setup && sudo dphys-swapfile swapon
```
---
## Aggiornare wg-easy
Esegui mensilmente per ricevere patch di sicurezza: