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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user