一个用golang写的高性能后端处理模块包git
https://github.com/halokid/MonRabitgithub
有须要更新功能能够提,能用的话记得start一下哈,谢谢golang
# 项目地址为 http://github.com/r00tjimmy/high-performance-net-handler # go get获取 go get github.com/r00tjimmy/high-performance-net-handler
package main import ( "github.com/r00tjimmy/high-performance-net-handler/worker" ) var ( max_worker = 3 max_job = 10 handle_type = "http" // set network protocol type ) func main() { // make the worker, listening work_pool channel dispatcher := worker.NewDispatcher(max_worker, handle_type) dispatcher.Run() // get requet request := worker.NewRequest(max_job, handle_type) request.Run() }
cd examples # just build make build after build, you can run with ./hpnh in current folder # just test make gotest # auto build and run make all
硬件信息: 4C 16Gapache
操做系统版本: CentOS 7.4 x64后端
一样的硬件, 同一个操做系统,对比 Apache/2.4.12 和 hpnh 做为 HTTP后端服务器的性能, 使用该网络模块比原生的apache默认配置性能要高三倍以上,详细的性能报告文件在 preformance_reports 文件夹里面。服务器