Gain is a high-performance io_uring networking framework written entirely in Go.
Report Bug
·
Request Feature
Gain is a high-performance networking framework written entirely in Go. It uses io_uring - a new asynchronous I/O API for Linux created by Jens Axboe from Facebook. Currently only Linux is supported.
WARNING: This is an alpha version so it is not yet stable enough to use in a production environment.
Articles about the project:
See examples:
Gain requires Go 1.20+
go get -u github.com/pawelgaczynski/gain@v0.4.0-alpha
See the open issues for a full list of proposed features (and known issues).
AWS EC2 instance: m6i.xlarge
vCPU: 4
RAM: 16GB
OS: Ubuntu 22.04 LTS
Kernel: 5.15.0-1026-aws
Go: go1.19.3 linux/amd64
Number of connections: 512
Benchmark type: see TechEmpower Plaintext
Run this script on the server machine before starting Gain. The first parameter is the name of network interface (e.g. eth0, ens5).
#!/bin/bash
systemctl stop irqbalance.service
export IRQS=($(grep $1 /proc/interrupts | awk '{print $1}' | tr -d :))
for i in ${!IRQS[@]}; do echo $i > /proc/irq/${IRQS[i]}/smp_affinity_list; done;
export TXQUEUES=($(ls -1qdv /sys/class/net/$1/queues/tx-*))
for i in ${!TXQUEUES[@]}; do printf '%x' $((2**i)) > ${TXQUEUES[i]}/xps_cpus; done;
To understand how it was achieved read an excellent article: Extreme HTTP Performance Tuning
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the Apache 2.0 License. See LICENSE
for more information.
Paweł Gaczyński - LinkedIn
Project Link: https://github.com/pawelgaczynski/gain