---
title: "Bringing serverless functions closer to the speed of wire"
description: "Modal rebuilt its serverless I/O plane, which queues Function inputs and outputs, and now runs it in at least four regions."
url: "https://swe.quest/articles/bringing-serverless-functions-closer-to-the-speed-of-wire-4593ae513494961f"
canonical: "https://modal.com/blog/bringing-serverless-functions-closer-to-the-speed-of-wire"
source: "Modal"
published: "2026-08-04"
difficulty: "medium"
kind: "Case study"
reading_minutes: 5
tags: ["serverless","performance","system-design","go","messaging"]
---

# Bringing serverless functions closer to the speed of wire

A post on [Modal](https://swe.quest/sources/modal.md), published 2026-08-04, 5 min read, Case study. Original: [https://modal.com/blog/bringing-serverless-functions-closer-to-the-speed-of-wire](https://modal.com/blog/bringing-serverless-functions-closer-to-the-speed-of-wire)

## Summary

Modal rebuilt its serverless I/O plane, which queues Function inputs and outputs, and now runs it in at least four regions. A new \`routing\_region\` flag lets callers avoid round trips to us-east, and the completed migration cut end-to-end Function Call latency by about 80ms at p50. The redesign moves non-critical work like autoscaling stats and dashboard events to the background and minimizes shared-storage access on the hot path, using client-side metadata caching and JWT-based auth. It also rewrites the server layer from async Python to Go to avoid event-loop lag, and stays on Redis 7.1 for its Redis-streams queues after load tests showed CPU spikes from 7.2 onward. Users are advised to route near their clients, keep payloads under 2MiB to skip blob-storage uploads, and batch small inputs.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)
- [Go](https://swe.quest/tags/go.md) (Languages)
- [Queues & messaging](https://swe.quest/tags/messaging.md) (Backend & APIs)

## Prerequisites

- serverless functions ([easy posts on Serverless](https://swe.quest/tags/serverless.md?difficulty=easy))
- Redis basics ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- gRPC ([easy posts on RPC & gRPC](https://swe.quest/tags/rpc.md?difficulty=easy))

## Keywords

Modal, Redis streams, Valkey, ElastiCache, gRPC, JWT

## Related posts

- [Lambda on hard mode: Inside Modal's web infrastructure](https://swe.quest/articles/lambda-on-hard-mode-inside-modal-s-web-infrastructure-9e5302ebea41d109.md): Modal · 2024-03-14 · Medium · 17 min read · Serverless, Networking, Rust, System design, Real-time systems
  Modal's modal-http service, written in Rust on hyper and Tokio, serves HTTP and WebSocket traffic for serverless functions by translating each request into a function call instead of reverse-proxying to containers.
- [Modal's serverless Servers](https://swe.quest/articles/modal-s-serverless-servers-c4c4d9aad435b2d6.md): Modal · 2026-06-25 · Medium · 10 min read · Load balancing, Serverless, Inference & serving, Rust, Performance engineering
  Modal Servers are a low-latency HTTP/WebSocket/gRPC serving primitive that cut p50 request latency from 39ms to 6ms versus Modal Web Functions by dropping platform-managed queueing and keeping network calls off the hot path.
- [Sub-10ms Postgres queries for Vercel Edge Functions](https://swe.quest/articles/sub-10ms-postgres-queries-for-vercel-edge-functions-6bc9caef6fab65ca.md): Neon · 2023-07-10 · Medium · 3 min read · PostgreSQL, Serverless, CDN & edge, Performance engineering, TypeScript
  Neon's serverless Postgres driver now supports SQL-over-HTTP via fetch, and Neon's proxy adds opt-in experimental connection caching (\`fetchConnectionCache\`).
- [Asynchronous computing at Meta: Overview and learnings](https://swe.quest/articles/asynchronous-computing-at-meta-overview-and-learnings-38025981fbc83823.md): Meta Engineering · 2023-01-31 · Medium · 10 min read · Serverless, Queues & messaging, Scheduling, Distributed systems, System design
  Meta re-architected Async tier, its serverless asynchronous computing platform running multi-trillion workloads per day, by splitting an overloaded Dispatcher into data-source-specific "tailers" and a source-agnostic scheduler.
- [How Modal uses ClickHouse to power real-time observability for AI workloads](https://swe.quest/articles/how-modal-uses-clickhouse-to-power-real-time-observability-for-ai-workloads-a1efae326a0a9591.md): ClickHouse · 2025-11-05 · Medium · 6 min read · Analytics & OLAP, Observability, Stream processing, Scaling
  Modal powers three customer-facing observability dashboards (function scaling, per-call timeline, latency percentiles) from a single ClickHouse Cloud table ingesting 1–2 million events per minute and holding ~500 billion logs.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
