Backend Engineering · 5 min read · November 2024

Building Upbot: Handling 50,000+ Daily Health Checks on Serverless Cold Starts

Serverless functions are cost-effective but suffer from cold starts. Here is how we engineered Upbot to monitor endpoints and maintain high availability.

Prince Pal

Prince Pal

Software Engineer

Overcoming the Serverless Cold-Start Dilemma

Serverless compute platforms like Vercel, AWS Lambda, and Render are great for scaling from zero, but when traffic is sporadic, the dreaded cold-start latency can degrade user experience by 3 to 10 seconds.

To solve this for our own projects and community services, I built Upbot—a distributed heartbeat and warm-up engine.

System Architecture

  • ✓Scheduler Engine: Written in Java Spring Boot with non-blocking async HTTP clients.
  • ✓Storage Layer: MongoDB for high-write-throughput ping logs with TTL indexes.
  • ✓Real-Time Dashboard: Next.js & Tailwind displaying latency percentiles (P50, P95, P99) and uptime status.
  • java
    @Service
    public class PingSchedulerService {
        private final WebClient webClient;

    public PingSchedulerService(WebClient.Builder builder) { this.webClient = builder.build(); }

    @Async public CompletableFuture<PingResult> probeEndpoint(String url) { long start = System.currentTimeMillis(); return webClient.get() .uri(url) .retrieve() .toBodilessEntity() .map(response -> new PingResult(url, response.getStatusCode().value(), System.currentTimeMillis() - start)) .toFuture(); } }

    Today, Upbot reliably executes over 50,000 automated probes daily with a 99.9% scheduling precision.

    Technologies & Concepts Covered:
    Java
    Spring Boot
    MongoDB
    High Availability
    Monitoring
    Prince Pal

    Written by Prince Pal

    Full Stack & Backend Engineer · 7x Hackathon Winner · Open source mentor

    Shoot an Email ↗
    @princepal