DEV Community

Cover image for I Added an AI-Adjacent Predictor to gRPC's Flow Control. It Made Things Worse (On Purpose)
Yusuf Temel
Yusuf Temel

Posted on

I Added an AI-Adjacent Predictor to gRPC's Flow Control. It Made Things Worse (On Purpose)

A question that kept nagging me: if you introduce an AI-adjacent predictor into a critical network protocol, does it actually help — or does it just add risk?

I don't have a background in gRPC internals. But I do think a lot about system boundaries — where you let a model make a suggestion, and where you force a hard, deterministic limit around it.

So I built a small PoC to test the idea directly on gRPC's HTTP/2 flow control:

→ A 1D Kalman Filter (not ML — classical control theory) estimates the ideal window size from telemetry.
→ A deterministic guardrail hard-clamps every recommendation to ±20% per step, regardless of what the estimator outputs.
→ A 3-state circuit breaker (CLOSED / OPEN / HALF_OPEN) falls back to standard reactive BDP the moment efficiency drops.

Then I ran an A/B benchmark against gRPC's standard reactive estimator. The result wasn't what I expected:

Estimation accuracy was actually 8.1% worse than the standard approach. Settling time was identical.

But bufferbloat / OOM risk went from unconstrained to mathematically bounded at zero.

That's the actual finding: this isn't a performance optimization. It's a risk optimization. You trade a small accuracy margin for a hard, provable ceiling on worst-case behavior — the same principle used in fly-by-wire systems and industrial control (PID controllers, SCADA), just applied at the transport layer.

It's a standalone PoC — doesn't touch grpc-core, validated on synthetic traffic, not production telemetry. That's the honest scope of it, and probably the next thing to fix.

Repo: [https://github.com/Yusuftmle/bounded-grpc-optimizer]

Curious if anyone working closer to transport-layer internals has thoughts on where this breaks down.

Top comments (0)