newReleased v1.3.0

Build high-performance networking applications in Go

On top of a variety of protocols of HTTP, RPC, WebSocket, Redis, etc.

Gnet is the fastest networking framework in Go.

Why Gnet?

Ultra Fast

Built in Go, Gnet is ultra fast and memory efficient. It's designed to create a networking server framework for Go that performs on par with Redis and Haproxy for networking packets handling.

Lock Free

Gnet is lock-free during the entire runtime, which speeds gnet up regardless of the synchronization issue.

Concise & Easy-to-use APIs

Gnet provides concise and easy-to-use APIs for users, it only exposes the essential APIs and takes over most of the tough work for users, minimizes the complexity of business code so that developers are able to concentrate on business logic instead of the underlying implementation.

Multiple Porotocols

Gnet supports multiple protocols/IPC mechanism: TCP, UDP and Unix Domain Socket, enabling you to develop a variety of networking applications.

Cross Platform

Gnet is devised as a cross-platform framework, as a result, it works faultlessly on multiple platforms: Linux, FreeBSD, DragonFly BSD, Windows.

Load Balancing

Gnet supports multiple load-balancing algorithms: Round-Robin, Source-Addr-Hash and Least-Connections, enabling users to choose the most suitable load-balancing algorithm based on their business scenarios.

Networking model of multiple reactors

Learn how gnet works

Cross Platform

Built on Linux, FreeBSD, DragonFly BSD, Darwin, Windows
        
UNIX & Windows
X86_64, ARM64
Light-weight
Ultra-fast

How to install gnet

We highly recommend that you install gnet via Go Modules

Run go get to download gnet:

go get -u github.com/panjf2000/gnet

gnet is available as a Go module, with Go 1.11 Modules support (Go 1.11+), just simply import "github.com/panjf2000/gnet" in your source code and go [build|run|test] will download the necessary dependencies automatically.

Performance

Benchmarks on TechEmpower
# Hardware Environment
CPU: 28 HT Cores Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz
Mem: 32GB RAM
OS : Ubuntu 18.04.3 4.15.0-88-generic #88-Ubuntu
Net: Switched 10-gigabit ethernet
Go : go1.14.x linux/amd64

All languages

This is the top 50 on the framework ranking of all programming languages consists of a total of 422 frameworks from all over the world where gnet is the runner-up.

Go

This is the full framework ranking of Go and gnet tops all the other frameworks, which makes gnet the fastest networking framework in Go.


To check the full ranking list, visit TechEmpower Plaintext Benchmark.