Resource Usage

Measured CPU, memory, disk, network, and hardware requirements for the ServerBee Agent, plus historical Server observations.

This page documents measured resource requirements and runtime performance for the ServerBee Agent (v1.0.0-beta.7), alongside preserved historical observations for the Server and earlier releases. For SQLite database growth estimates, see Storage & Capacity Planning.

Agent

Based on controlled Linux VM benchmarks of serverbee-agent v1.0.0-beta.7 (statically linked musl binary, server-dictated 3-second reporting interval, default capabilities). For full scenario tables, stress tests, and methodology, see the Agent benchmark report.

ResourceAbsolute floor (minimal config)Minimum viable (default config)Recommended (production / active use)Notes
CPU1 vCPU (CPUQuota=5%)1 vCPU (shared / burstable)1+ vCPUSteady-state uses 0.14%–0.19% of 1 core; 0 CPU throttles down to CPUQuota=5%
Available RAM (Agent budget)16 MiB ([security] enabled = false, no swap)32 MiB (cold boot + default security_events)64 MiB (128 MiB with Web Terminal or >500 procs)Cold-cache default peaks at 21.0 MiB cgroup (0 reclaim stalls at 16 MiB, 0 pressure at 24 MiB)
Host VPS total RAM64–128 MiB Linux VPS128–256 MiB Linux VPS512 MiB+ Linux VPSAgent uses <2%–5% of a 512 MiB VPS; host kernel and init dominate total RAM
Disk space20 MiB30 MiB50–100 MiBBinary is 13.36 MiB (amd64) / 12.10 MiB (arm64); total install is 13.53 MiB. Reserve 2× binary size for self-upgrade .bak rollback
Network bandwidth2 Kbps (~0.45 GB/mo)5 Kbps (~0.5 GB/mo)100 Kbps+ (Web Terminal / File Manager)Measured idle steady-state: 158 B/s TX + 0.8 B/s RX (~412 MB/month)
OS & libcLinux with /proc (no glibc required)Linux + systemd or OpenRCLinux 5.x/6.x with systemd (cgroup v2)Official Linux amd64/arm64 binaries are statically linked musl (not a dynamic executable)
Open FDs (nofile)>= 256 (<150 host procs)>= 1024 (default ulimit -n)>= 4096–65536 (>500 host procs)sysinfo keeps persistent /proc/<pid>/stat FDs (~1:1 with host processes); set LimitNOFILE=65536 on dense hosts

Measured Performance (v1.0.0-beta.7)

Measured on 2026-11-24 using official serverbee-agent v1.0.0-beta.7 (linux-amd64 static musl, deploy/install.sh binary mode) on Ubuntu 24.04.5 LTS (systemd 255, cgroup v2, KVM AMD EPYC) reporting every 3 seconds over WAN TLS WebSocket to a v1.0.0-beta.7 Server.

Steady-State Idle Soak (300s)

Metric1 vCPU / 4 GiB VM2 vCPU / 8 GiB VMScope
CPU (1-core avg / p95 / max)0.144% / 0.426% / 0.544%0.190% / 0.568% / 0.791%Cgroup v2 cpu.stat (0.143% / 0.190% via /proc)
Agent VmRSS (RssAnon + RssFile)11.09 MiB (0.82 + 10.27 MiB)11.18 MiB (0.91 + 10.27 MiB)Process resident memory (PSS: 11.08 / 11.18 MiB)
Systemd cgroup memory (warm cache)2.62 MiB (max 2.75 MiB)2.95 MiB (max 3.19 MiB)Includes journalctl -f child; drops 54% to 1.21 MiB when [security] enabled = false
Systemd cgroup memory (cold cache)19.0 MiB (peak 21.0 MiB)—After drop_caches=3 with MemoryMax=24M (includes faulted executable pages)
Memory stability (300s RssAnon delta)+12 KiB (+1.89 KiB/min)+8 KiB (+0.65 KiB/min)Flat plateau over 100 collection cycles, zero leak
Threads / Open FDs3 / 46 (43–47)5 / 51 (48–52)Tokio spawns 1 worker thread per vCPU
Network bandwidth (exact TCP socket)158.4 B/s TX, 0.8 B/s RX158.0 B/s TX, 0.8 B/s RXss -tinp; ~475 B per 3s TLS frame (~412 MB/month)
Binary / total installed disk13.36 MiB / 13.53 MiB13.36 MiB / 13.53 MiBlinux-amd64 static musl (linux-arm64 binary: 12.10 MiB)

Workload, Stress & Cgroup Floor Highlights

  • Startup & enrollment: Cold-start enrollment over trans-Pacific WAN completed in 1.26 s (~25 ms local agent work; remainder was WAN RTT/TLS). Warm systemctl restart reconnected in 0.93 s.
  • Active dashboard viewing: Zero measurable extra agent CPU, memory, or network cost — the Server fans out already-received telemetry to browsers.
  • Active Web Terminal (PTY): Adds +1 thread, +2.39 MiB cgroup memory (interactive shell child; agent RssAnon rose by +7 KiB), 0.44% avg cgroup CPU (3.47% max), and 971 B/s TX during periodic command output.
  • Host CPU & I/O stress: Under 100% host CPU saturation, telemetry remained uninterrupted (0.175% agent CPU). Heavy disk fsync loops plus 200 active local TCP sockets added only +0.026% CPU and +83 KiB cgroup memory.
  • High process count (>500 processes): Spawning 500 sleeping processes (519 total) scaled open FDs ~1:1 (51 → 545), tripled CPU (0.19% → 0.57% avg, 3.00% max), and increased cgroup memory 2.3× (2.95 → 6.80 MiB) because sysinfo keeps persistent /proc/<pid>/stat FDs to count processes.
  • Offline & reconnect recovery: During a 40s packet blackhole, memory and FDs stayed flat with zero restarts; after the half-open TCP socket closed, reconnection to Sent SystemInfo took 1.36 s.
  • Hard cgroup v2 floors (1 vCPU, MemorySwapMax=0):
    • Warm-cache OOM boundary (with 300-process burst): survives 6 MiB (default) / 4 MiB (security.enabled = false), OOMs at 4 MiB / 3 MiB.
    • Cold-cache zero-thrash floor (drop_caches=3, default): 16 MiB (0 reclaim stalls, 0 OOM); 24 MiB has zero reclaim pressure. Setting MemoryMax below 16 MiB avoids OOM down to 6 MiB but causes heavy executable code-page thrashing (>137k reclaim stalls in 20s).
    • CPUQuota floor: 0 throttles down to 5% (2% still keeps telemetry flowing with 59 ms throttled over 45s).

Low-Resource VPS & Dense-Host Tuning

  • Low-RAM VPS (<= 256 MiB RAM): Use the static binary (deploy/install.sh) rather than Docker. If you do not need SSH journal security watching, set [security] enabled = false in /opt/serverbee/etc/agent.toml to eliminate the journalctl -f child process and cut steady-state cgroup memory by ~54% (1.21 MiB warm). Keep unused capabilities (terminal, exec, file, docker) disabled. Safe systemd guardrails are MemoryMax=64M and CPUQuota=15% (use MemoryMax=32M only without terminal/exec and below 300 processes; do not go below 24M with default config).
  • Dense hosts (>500 processes / containers): Add a systemd drop-in with LimitNOFILE=65536 and MemoryMax=128M (or leave memory uncapped) so sysinfo's /proc descriptors do not hit the default 1024 open-file limit.

Historical v0.9.3 Agent Observation

Preserved for historical reference: earlier notes for v0.9.3 (dated 2026-05-19, 4-core AMD EPYC 7B13 / 8 GB / Ubuntu 24.04 KVM, 3s interval, raw logs and exact linkage unarchived) recorded ~10 MB → ~34 MB ps RSS (~4.3 MB → ~27 MB systemd cgroup) over 8 hours, ~0.5%–0.7% CPU, 9–10 threads, an ~11 MB binary, and a protocol-based network estimate of <= 1–2 KB/s. That 8-hour reading alone did not establish a long-term plateau or libc linkage; use the v1.0.0-beta.7 measurements above for current deployments.

Server

Source: the historical measurement notes originally recorded on this page for v0.9.3, dated 2026-05-19 unless noted otherwise. Raw benchmark logs and exact binary linkage were not archived with those notes. Measure your deployed version, allocator, Agent count, enabled collectors, and query load before setting Server resource limits.

Historical Railway observation

The original page recorded roughly 140–170 MB with a small number of Agents and MALLOC_ARENA_MAX=2 present in the environment. It also reported 800 MB–1 GB after 2–3 days in another run. The notes do not capture exact build linkage, Agent count, query load, or a controlled comparison. These are historical readings, not evidence that the environment variable caused the difference or a memory target for the current release.

Historical self-hosted idle observation

The v0.9.3 notes describe a near-idle Server on the same VPS with no active Agent connections:

ResourceObservedScope
Memory (systemd cgroup)~15 MB, peak ~23.8 MBHistorical idle observation, not a loaded-server requirement
Threads7Observed tokio runtime
CPUNear zeroIdle workload
Binary size~47 MBHistorical linux-amd64 binary with the frontend SPA embedded

Allocator and build scope

MALLOC_ARENA_MAX applies to glibc's allocator. Official Linux release binaries and Docker images use musl, where this variable has no effect. The standard deployment examples therefore do not set it. For a custom glibc build, assess allocator behavior against that build's measurements rather than applying the old Railway numbers.

A separate release-toolchain regression affected v1.0.0-beta.1: the recorded idle Server grew about 20 MB per day because of cross-thread free behavior in Zig 0.16's bundled allocator. The release workflow now pins Zig 0.15.2; the correction shipped in v1.0.0-beta.2. Its cause, observation scope, and reproduction procedure are recorded in the release memory soak runbook. This is a distinct observation from the v0.9.3 figures above. Use a current release and investigate sustained growth on the actual deployed build.

Disk

Server disk use includes SQLite, uploaded brand images, downloaded GeoIP/ASN MMDB files, and configuration. Database growth depends on Agent count, enabled features, and retention. See Storage & Capacity Planning for database estimates and Backup and Restore for files outside SQLite. Reserve space for WAL, bursts, and complete backup sets in addition to the base database.

Caveats

  • The historical idle Server readings do not describe many Agents or heavy query load.
  • Cgroup memory (memory.current) and process RSS (VmRSS / PSS) measure different scopes; compare like with like and account for warm vs cold page cache when setting MemoryMax.
  • A 5-minute soak confirms flat steady-state behavior for the Agent reporting loop, but hosts running additional capabilities (Docker monitoring, frequent remote commands, or high process churn) should still validate limits under their real workload.