Uptime Medics Architecture & Performance Benchmark: High-Performance Rust Uptime Monitoring

Live web application screenshot and interface of Uptime Medics - High-Performance Uptime & Incident Monitoring

Modern infrastructure demands observability tools that are as resilient and lightweight as the services they monitor. Uptime Medics answers this challenge with a radical architectural approach: a distributed, high-performance uptime and incident monitoring platform written entirely in Rust, delivered as a single binary operating under 30 MB of baseline RAM.

Key Takeaways

  • Ultra-Lean Runtime: Single binary (Axum + Tokio + SQLite WAL) consuming < 30 MB RAM baseline.
  • Zero-Signup Community Pool: Public monitoring with 10-second juggler rotation—no accounts required.
  • Defense-in-Depth SSRF Protection: Filtering DNS resolver defeats rebinding; redirect hop inspection blocks metadata endpoint access.
  • Smart Incident State Machine: 2-failure confirmation with flapping suppression and batched SQLite writes.
  • Multi-Method Probing: HEAD, GET, POST, PATCH, PUT, DELETE, OPTIONS with custom headers/payloads up to 64 KB.
Live Project Access: https://uptime.nevatal.id

Live web application screenshot and interface of Uptime Medics - High-Performance Uptime & Incident Monitoring
Live web application interface of Uptime Medics – High-Performance Uptime & Incident Monitoring (https://uptime.nevatal.id)

The Engineering Challenge: Why Uptime Medics Was Architected

Reliable uptime monitoring is foundational, yet existing solutions present a trilemma for developers and small teams:

  1. Commercial Bloat & Paywalls: Enterprise APM suites (Datadog, New Relic, Pingdom) impose strict monitor caps on free tiers and demand friction-heavy registrations for basic HTTP health checks.
  2. Resource-Heavy Self-Hosted Tools: Popular open-source monitors (e.g., Uptime Kuma) rely on Node.js/Electron runtimes consuming 300–800 MB RAM—inefficient for low-cost VPS deployments.
  3. Critical SSRF Vulnerabilities: Public monitoring forms create severe Server-Side Request Forgery vectors. Attackers probe internal networks, loopback services (localhost), cloud metadata endpoints (169.254.169.254), or exploit DNS rebinding to pivot into cloud infrastructure.
  4. Alert Fatigue & Flapping: Rudimentary monitors fire on single network blips or bombard engineers with repetitive cascades during rapid state oscillations.

Uptime Medics eliminates this trilemma through Rust’s zero-cost abstractions, async runtime efficiency, and a security-first network stack.

Core Architecture & Technical Stack Deep-Dive

System Topology: The Single-Binary Deployment Model

Uptime Medics is a self-contained executable integrating four critical subsystems:

┌────────────────────────────────────────┐
│       Uptime Medics Single Binary      │
│         (Axum 0.8 + Tokio 1)           │
│                                        │
│  ┌─────────────┐ ┌─────────────────┐  │
│  │ Embedded    │ │ Axum HTTP API   │  │
│  │ Static FE   │ │ Router          │  │
│  │ (rust-embed)│ └────────┬────────┘  │
│  └──────┬──────┘          │           │
│         ▼                 ▼           │
│  ┌─────────────────────────────────┐  │
│  │      AppState Composition Root  │  │
│  │ (DB Pool, Mailer, Scheduler)    │  │
│  └─────────────┬──────────────────┘  │
│                │                     │
│      ┌─────────┴─────────┐           │
│      ▼                   ▼           │
│ ┌──────────┐       ┌────────────┐   │
│ │ SQLite   │       │ Outbound   │   │
│ │ (WAL)    │       │ HTTP Prober│   │
│ └──────────┘       │ (Reqwest)  │   │
│                    └────────────┘   │
└────────────────────────────────────────┘

Technology Stack & Version Lock

Layer Technology Version Role
Runtime Rust 1.82+ Memory safety, zero-cost async
Web Framework Axum 0.8 High-performance HTTP routing
Async Runtime Tokio 1.x Task scheduling, I/O multiplexing
HTTP Client Reqwest 0.12 Outbound probing with custom DNS
Database SQLx + SQLite 0.8 / WAL Mode Embedded persistence, concurrent reads
Auth Argon2id + JWT Latest Password hashing, stateless sessions
Email Lettre 0.11 SMTP notification delivery
Frontend Vanilla JS/HTML ES Modules Embedded via rust-embed

SQLite WAL Mode: Concurrency Without a Server

By leveraging SQLite in Write-Ahead Logging (WAL) mode via SQLx, Uptime Medics achieves:

  • Concurrent Readers: Multiple dashboard queries execute without blocking the scheduler’s write path.
  • Durability: Checkpointing ensures crash consistency without a separate database process.
  • Batched Write Buffering: The incident state machine aggregates state transitions, flushing to disk in optimized batches to minimize I/O overhead.

Async Scheduling Engine: The Juggler

The core scheduler (“The Juggler”) drives both private and community monitoring:

  • Per-Monitor Intervals: Configurable 30 seconds to 24 hours per endpoint.
  • Community Rotation: Public monitors are dynamically juggled—10 random endpoints displayed every 10 seconds on the landing page.
  • Timeout Enforcement: Strict 1–60 second execution timeouts prevent hung probes from stalling the scheduler.

Key Features Breakdown & Practical Benefits

1. Zero-Signup Community Monitoring Pool

Anyone can submit a public monitor instantly via the landing page. No email, no password, no OAuth. The frontend fetches live global health telemetry (aggregate up/down ratios, response time percentiles) and rotates 10 community monitors every 10 seconds, providing a real-time “pulse” of the monitored ecosystem.

2. Multi-Layer SSRF Defense (Defense-in-Depth)

This is the architectural cornerstone for multi-tenant safety. The stack implements four independent barriers:

  1. Filtering DNS Resolver: Custom reqwest DNS resolution intercepts A/AAAA responses. It strips 127.0.0.0/8, ::1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 (cloud metadata), and fc00::/7 (ULA) before the HTTP client connects.
  2. DNS Rebinding Mitigation: The resolver enforces TTL minimums and caches resolved IPs for the probe duration, preventing malicious domains from switching from

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *