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.
Gnet supports multiple protocols/IPC mechanism: TCP, UDP and Unix Domain Socket, enabling you to develop a variety of networking applications.
Gnet is devised as a cross-platform framework, as a result, it works faultlessly on multiple platforms: Linux, FreeBSD, DragonFly BSD, Windows.
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
How to install gnet
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.
# Hardware EnvironmentCPU: 28 HT Cores Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHzMem: 32GB RAMOS : Ubuntu 18.04.3 4.15.0-88-generic #88-UbuntuNet: Switched 10-gigabit ethernetGo : go1.14.x linux/amd64
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.
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.
gnetas the underlying network service in production.
If your project is also using
gnet, feel free to open a pull request to refresh this list of user cases.