evio is a small Go networking framework using direct epoll and kqueue syscalls for TCP, UDP, and Unix sockets with optional multithreaded loops.
Overview
evio targets high-throughput Go servers by bypassing the standard net package in favor of direct epoll and kqueue calls, similar in spirit to libuv or libevent. It was built as infrastructure for Tile38 and a planned Go L7 proxy and is not positioned as a drop-in net/http replacement.
Servers register event callbacks for serving, open, close, data, detach, and tick, then call Serve with one or more bind addresses. UDP mode delivers packets without buffering; multithreaded mode splits work across loops with configurable load balancing strategies.
Features include SO_REUSEPORT, flexible tickers, low memory use, and a simple API for echo, Redis-like, and basic HTTP examples under the examples directory. NumLoops and LoadBalance settings control concurrency and connection distribution.
Install with go get against github.com/tidwall/evio. Performance benchmarks are published for single-threaded localhost IPv4 scenarios.
Key features
- Epoll and kqueue event loops
- TCP UDP and Unix sockets
- Single or multithreaded NumLoops
- Random round-robin load balancing
- SO_REUSEPORT support
- Per-connection event callbacks
- Ticker events on intervals
- Example echo Redis HTTP servers
Use cases
- Custom high-throughput Go servers
- Embedded networking in data systems
- Learning syscall-driven event loops