一個用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 文件夾裏面。服務器