fix: cap NATS JetStream streams to prevent OOM crash

WIRELESS_REGISTRATIONS stream had a 256MB MaxBytes cap in a 256MB
container — guaranteed to crash under load. ALERT_EVENTS and
OPERATION_EVENTS had no byte limit at all.

- Reduce WIRELESS_REGISTRATIONS MaxBytes from 256MB to 128MB
- Add 16MB MaxBytes cap to ALERT_EVENTS and OPERATION_EVENTS
- Bump NATS container memory limit from 256MB to 384MB
- Add restart: unless-stopped to NATS in base compose
- Bump version to 9.8.2

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Staack
2026-03-23 07:52:07 -05:00
parent 231154d28b
commit e1d81b40ac
10 changed files with 13 additions and 10 deletions

View File

@@ -163,7 +163,7 @@ func NewPublisher(natsURL string) (*Publisher, error) {
Name: "WIRELESS_REGISTRATIONS",
Subjects: []string{"wireless.registrations.>"},
MaxAge: 30 * 24 * time.Hour, // 30-day retention
MaxBytes: 256 * 1024 * 1024, // 256MB cap
MaxBytes: 128 * 1024 * 1024, // 128MB cap
Discard: jetstream.DiscardOld,
})
if err != nil {