A high-performance, non-blocking I/O framework for Go optimized for massive connection scenarios like gateways and proxies.
NBIO is a non-blocking I/O framework written in pure Go, designed to handle massive concurrent connections with high performance and low memory overhead. It provides a scalable solution for infrastructure applications such as gateways and proxies, supporting protocols like TLS, HTTP/1.x, and WebSocket while maintaining basic compatibility with the standard net/http package.
Go developers building high-performance infrastructure applications like gateways, proxies, or servers that need to handle over a million concurrent WebSocket or TCP connections efficiently.
Developers choose NBIO for its optimized event-driven architecture that minimizes goroutine and memory usage under massive connection loads, significantly reducing GC pressure compared to standard blocking I/O. It offers flexible I/O modes (blocking, non-blocking, mixed) to balance performance and resource usage across different connection scales.
Pure Go 1000k+ connections solution, support tls/http1.x/websocket and basically compatible with net/http, with high-performance and low memory cost, non-blocking, event-driven, easy-to-use.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Handles over 1 million WebSocket connections with low memory overhead—benchmarks show ~1GB memory usage for 1M connections with 100k TPS, reducing GC pressure significantly.
Offers blocking, non-blocking, and mixed I/O modes (IOMod) to optimize performance and resource usage based on connection load, balancing goroutine counts and CPU/memory costs.
Uses epoll on Linux, kqueue on BSD/macOS for high-performance non-blocking I/O, ensuring scalable event-driven architecture on supported systems.
Supports TCP, UDP, TLS, HTTP/HTTPS 1.x, and WebSocket with Autobahn Test Suite compliance, providing robust protocol handling for infrastructure apps.
The author explicitly states NBIO performs worse than the Go standard library in regular connection scenarios due to goroutine affinity and buffer reuse issues, making it suboptimal for typical use.
Windows support is implemented via the standard net package only for debugging, not production, restricting cross-platform deployments for high-performance needs.
NBIO's advantages are limited to massive connection scenarios like gateways/proxies, and its architecture is complex compared to simpler epoll wrappers or standard I/O, increasing learning curve.