In a Go gRPC server, what is the primary benefit of making RPC handlers non-blocking?

Go & Rust interview question for Advanced practice.

Answer

It allows the server to handle a much higher number of concurrent requests, increasing throughput.

Explanation

Option B is correct. Each request runs in its own goroutine. If a handler blocks for a long time (e.g., waiting for a slow database query), that goroutine is tied up and cannot do other work. By using non-blocking I/O and offloading long-running tasks to worker pools, the handler can return quickly, freeing up resources and allowing the server to accept and process new incoming requests. This dramatically increases the server's concurrency and overall throughput.

Related Questions