Netpoll is a Go networking framework focused on RPC-style concurrency. It aims to reduce goroutine overhead compared with blocking net APIs.
Overview
Netpoll provides a non-blocking I/O networking stack for Go programs, especially RPC servers and clients where heavy logic should not wait on I/O one connection at a time. The standard library net package is built around blocking calls, which pushes many frameworks toward one goroutine per connection.
The library adds connection liveness checks, efficient buffering, goroutine pools, and memory reuse helpers. It supports TCP and Unix domain sockets and offers APIs to build clients with a dialer and servers with an event loop.
It is developed by ByteDance and underpins their Kitex RPC framework and Hertz HTTP framework. Design inspiration is cited from evio and netty-style architectures, oriented toward microservices rather than Redis-proxy style servers.
Supported operating environments include Linux and macOS; Windows is listed as unsupported. Benchmark projects compare Netpoll with other stacks under concurrency and timeout conditions.
Key features
- Non-blocking RPC-oriented networking
- LinkBuffer streaming read and write
- Connection IsActive health checks
- EventLoop server construction
- Client Dialer API
- TCP and Unix sockets
- Goroutine pool helper
- Memory cache reuse helper
Use cases
- High-concurrency RPC servers in Go
- Replacing net in custom RPC frameworks
- Connection pools with alive detection
- Microservice network stacks
- Kitex or Hertz underlying transport