未维护! 一款使用 Go 编写的通用高性能电力开关和代理服务器
guard is a generic high performance circuit breaker & proxy written in Go. It has four major components:
I've made a simple benchmark on my laptop(i5-3210M CPU @ 2.50GHz with 4 cores):
…
For now, guard's proxy performance is about 55% of Nginx 1.76x faster than Nginx, and I'm still working on it! Don't worry, it will become better and better!
By the way, thanks the suggestion
from @dongzerun, by configure the GOGC in environment,
guard's proxy performance is about 70% of Nginx. guard does not allocate much memory now,
GOGC does not make a change, but still say thanks to @dongzerun!
moved to https://github.com/jiajunhuang/guard/projects/1
go get -u:$ go get -u github.com/jiajunhuang/guard
$ guard
http://127.0.0.1:12345/app with json like this:{
"name": "www.example.com",
"backends": ["127.0.0.1:80", "127.0.0.1:80", "127.0.0.1:80"],
"weights": [5, 1, 1],
"ratio": 0.3,
"paths": ["/"],
"methods": ["GET"],
"fallback_type": "text",
"fallback_content": "hello world"
}
I'm doing it like this:
$ http POST :12345/app < backends.json
HTTP/1.1 200 OK
Content-Length: 8
Content-Type: text/plain; charset=utf-8
Date: Sun, 21 Jan 2018 08:51:16 GMT
success!
$ http :23456 'Host: www.example.com'
HTTP/1.1 200 OK
...
…
net/http to fasthttp, it's super fast now!暂无开放 Issues,或尚未同步最近议题。