🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go./ gnet 是一个高性能、轻量级、非阻塞的事件驱动 Go 网络框架。
English | 🇨🇳中文
gnetis an event-driven networking framework that is fast and lightweight. It makes direct epoll and kqueue syscalls rather than using the standard Go net package and works in a similar manner as netty and libuv, which makes
gnetachieve a much higher performance than Go net.
gnetis not designed to displace the standard Go net package, but to create a networking server framework for Go that performs on par with Redis and Haproxy for networking packets handling.
gnetsells itself as a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go which works on transport layer with TCP/UDP protocols and Unix Domain Socket , so it allows developers to implement their own protocols(HTTP, RPC, WebSocket, Redis, etc.) of application layer upon
gnetfor building diversified network applications, for instance, you get an HTTP Server or Web Framework if you implement HTTP protocol upon
gnetwhile you have a Redis Server done with the implementation of Redis protocol upon
gnetand so on.
gnetderives from the project:
eviowhile having a much higher performance and more features.
TCP,
UDPand
Unix Domain Socket
Round-Robin,
Source-Addr-Hashand
Least-Connections
epollon Linux and
kqueueon FreeBSD/DragonFly/Darwin
gnetClient
# 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
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
gnetis the runner-up.
This is the full framework ranking of Go and
gnettops all the other frameworks, which makes
gnetthe fastest networking framework in Go.
To see the full ranking list, visit TechEmpower Plaintext Benchmark.
# Machine information OS : Ubuntu 20.04/x86_64 CPU : 8 processors, AMD EPYC 7K62 48-Core Processor Memory : 16.0 GiBGo version and settings
Go Version : go1.15.7 linux/amd64 GOMAXPROCS : 8
Netwokr settings
TCP connections : 300 Test duration : 30s
# Machine information OS : macOS Catalina 10.15.7/x86_64 CPU : 6-Core Intel Core i7 Memory : 16.0 GiBGo version and configurations
Go Version : go1.15.7 darwin/amd64 GOMAXPROCS : 12
Netwokr settings
TCP connections : 100 Test duration : 20s
Please visit the official website for more details about architecture, usage and other information of
gnet.
Source code in
gnetis available under the MIT License.
Please read the Contributing Guidelines before opening a PR and thank you to all the developers who already made contributions to
gnet!
The following companies/organizations use
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.
Support us with a monthly donation and help us continue our activities.
Become a bronze sponsor with a monthly donation of $10 and get your logo on our README on Github.
Please be sure to leave your name, Github account or other social media accounts when you donate by the following means so that I can add it to the list of donors as a token of my appreciation.
If you need a tailored version of
gnetand want the author to help develop it, or bug fix/fast resolution/consultation which takes a lot of effort, you can request paid support here.
gnethad been being developed with
GoLandIDE under the free JetBrains Open Source license(s) granted by JetBrains s.r.o., hence I would like to express my thanks here.