NOT MAINTAINED! A generic high performance circuit breaker & proxy server written in Go
NOT MAINTAINED! A generic high performance circuit breaker & proxy server written in 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 guard does not allocate much memory now,
GOGC in environment,
guard's proxy performance is about 70% of Nginx.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$ guardhttp://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!No open issues yet, or sync has not completed.