Sockudo
Server

Observability

Health probes, metrics, logs, and disconnect cleanup tuning.

Health Endpoints

  • GET /up: global service health.
  • GET /up/{appId}: app-specific health.

Behavior:

  • 200 OK with X-Health-Check: OK or DEGRADED
  • 503 Service Unavailable with X-Health-Check: ERROR
  • 404 Not Found for unknown app ID on app-specific checks

Metrics Endpoint

Prometheus metrics are served on metrics listener (default :9601):

curl http://127.0.0.1:9601/metrics

Configure:

METRICS_ENABLED=true
METRICS_PORT=9601
METRICS_PROMETHEUS_PREFIX=sockudo_

Usage Endpoint

GET /usage returns memory statistics snapshot from server process context.

Logging

Control output format and verbosity with:

DEBUG=true
RUST_LOG=info,sockudo=debug
LOG_OUTPUT_FORMAT=human   # or json
LOG_COLORS_ENABLED=true
LOG_INCLUDE_TARGET=true

Disconnect Cleanup Queue

Async cleanup avoids mass-disconnect stalls:

CLEANUP_ASYNC_ENABLED=true
CLEANUP_QUEUE_BUFFER_SIZE=50000
CLEANUP_BATCH_SIZE=25
CLEANUP_BATCH_TIMEOUT_MS=50
CLEANUP_WORKER_THREADS=auto

auto worker mode scales by CPU count.

Copyright © 2026