ModalAnnouncement
Bringing serverless functions closer to the speed of wire
Summary
Modal’s legacy I/O plane routed all function inputs and outputs through us-east servers, adding up to ~200ms of network latency for calls from other regions. The new geographically distributed I/O plane, available in four or more regions, reduces end-to-end function call latencies by roughly 80ms at p50. The redesign involved moving non-critical work to background async processing, minimizing shared storage interactions on the hot path, and rewriting the server layer in Go for better concurrency. The team evaluated Valkey but chose Redis 7.1 because engine CPU usage spiked aggressively on Redis 7.2 onwards during input queue load testing. Users can further optimize by selecting the nearest routing_region, keeping input and output payloads under 2MiB to avoid blob storage uploads, and batching small inputs to reduce network hops.
Context
Modal’s legacy I/O plane in us-east added up to ~200ms roundtrip latency for function calls from other regions, dominating inference time for fast models. The new I/O plane is geographically distributed across four or more regions, and the migration to us-east was completed this week, yielding an 80ms p50 latency reduction.
Approach / What changed
Redesigned the I/O plane to be geographically distributed, with non-critical work moved to async background, minimized hot-path shared storage interactions, server layer rewritten in Go, and Redis 7.1 chosen over Valkey due to CPU spikes on Redis 7.2+.
Takeaways
The new regional I/O plane reduces p50 function call latency by roughly 80ms compared to the legacy us-east-only routing.
Rewriting the server layer in Go improved concurrency for gRPC handling over async Python, which suffered from event loop lag under CPU-intensive operations.
Keep input and output payloads under 2MiB to avoid extra blob storage uploads; batch small inputs into one larger input to reduce network hops.
FAQ
How much latency does the new I/O plane save?
End-to-end function call latencies dropped by roughly 80ms at p50. The legacy system added up to ~200ms roundtrip for non-us-east regions, so the new regional plane significantly reduces that.
Why did Modal choose Redis 7.1 over Valkey?
During input queue load testing, engine CPU usage spiked aggressively on Redis 7.2 onwards. Valkey is forked from Redis 7.2 and uses I/O multithreading, but the team observed better performance with Redis 7.1.
What can users do to optimize function call performance?
Select the routing_region closest to clients, keep payloads under 2MiB to avoid blob storage uploads, and batch small inputs into one larger input to reduce network hops.
Source and freshness
- Source
- modal.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.