Google Open Source Load Balancer in Go
github.com
github.com
Note that this is a network-level load balancer that is tightly coupled with LVS, not a Layer 7 load balancer like HAProxy.
Seesaw is just a traffic cop. The kernel does all the work.
Cool to see this engine out in open source.
To build a VPN edge you also need cooperative tiered caches with some very counterintuitive cache admission and eviction algorithms, unicast front end with p2p (for vod) or multicast (for live) back end, multi-datacenter event aggregation and correlation, cookieless/db-less sessions, and a few other goodies, some of which you can now even find as Nginx plugins.
Assembling what you need is much easier now with HLS, DASH, etc., than it was in the MMS/RTSP/RTMP days.
As of last couple years, you could almost assemble a viable global VDN with off the shelf open source parts. If the open compute project keeps up its good work, the physical kit gets affordable too.
the part that makes it difficult to implement is that the hosts have to be on the same network. I didn't dive too much into the code but it looks like you also assign an additional interface to use as a VIP. I believe you'll need to be in your own network and not the cloud to implement this.
Still cool nonetheless!
[1]: https://www.digitalocean.com/community/tutorials/how-to-use-...
[2]: https://www.digitalocean.com/community/tutorials/how-to-crea...
[3]: https://www.digitalocean.com/community/tutorials/how-to-set-...
The reason I ask, I worked with one hosting provider who leveraged LVS for well over billions of impressions per month and was rock solid for all their client base.
I'm pretty interested in this, but not yet in a position to roll out a dedicated infrastructure.
https://github.com/wikimedia/PyBal
It actually is a bit different in that it advertises VIPs via BGP, so no floating IPs are needed, but you need to be able to configure your upstream routers, and its configuration is much more flexible.
https://github.com/google/seesaw/blob/master/common/seesaw/s...
go get -u golang.org/x/crypto/ssh
go get -u github.com/dlintw/goconf
go get -u github.com/golang/glog
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u github.com/miekg/dnsYou are not supposed to do this in Go. If you make changes that are API-incompatible, you need to create a new import path. From the Go FAQ:
Packages intended for public use should try to maintain backwards compatibility as they evolve. The Go 1 compatibility guidelines are a good reference here: don't remove exported names, encourage tagged composite literals, and so on. If different functionality is required, add a new name instead of changing an old one. If a complete break is required, create a new package with a new import path.
https://golang.org/doc/faq#get_version
Whether this is a good approach is the question, but pushing API compatibilities to an existing import path is considered to be bad.
(Since creating a new repository for each API-breaking version is annoying, there are sites such as http://gopkg.in/ that allow you to expose version branches as a different import paths.)
gopkg.in/mypackage.v3 -> github.com/go-mypackage/mypackage
gopkg.in/bob/mypackage.v3 -> github.com/bob/mypackage
...where v3 is a branch or tag named v3, v3.N or v3.N.M.What Go needs is a real package manager that uses the new 1.5 vendor directory to manage dependencies. There have been some attempts (godep, gb), but they aren't very good, especially if you look at how existing languages have solved this (Ruby's Bundler, Rust's Cargo).
[1] https://gopkg.in
fixed.
I like cargo's system for this.
Doing "go install github.com/google/seesaw" should do everything for you.
go get -u github.com/google/seesaw/...
Wouldn't it be fair for that submitter to get karma points?
The distinction is that this project is Google written/used not google supported.
Edit: Here's the official Google announcement: http://google-opensource.blogspot.com/2016/01/seesaw-scalabl...
EDIT: If you're going to down-vote this comment, at least provide detaro with the correct answer to his/her question!
The first is difficult for a lot of the commonly used languages, the second is hard for Python, Ruby, etc, the third is hard for C, C++, etc.
One downside (although some consider it an upside by design) is that it can be a bit more verbose than other languages since there is rarely any "magic". You can usually read any Go code and be pretty confident at what it does, because it doesn't allow you to hide complexity. This does tend to make the code more verbode.
I highly recommend taking the interactive Go Tour at https://tour.golang.org/welcome/1 because it will show you everything you need to get a high-level overview of Go's power.
Thanks for the response. I've been trying to decide between Go and Elixir as my next new language. Both languages sound like they have great features.
My understanding is that Go's TLS performance is dramatically less than other C-based implementations like OpenSSL. I remember reading something about some licensing collisions between the Go project and some TLS stuff such that optimized encryption code couldn't be incorporated into the Go project directly. Cloudflare got around it and has much better performance for TLS.
Apart from that, GC is still a big deal and the current net/http standard library produces a lot of garbage.
While GC will always carry a cost, great improvements have been made over the last year and continues to be an area of focus for each Go release. Rick Hudson gave a nice update on Go's GC improves at GopherCon 2015 [2][3]
[1] https://go-review.googlesource.com/#/c/8968
The LVS-based systems I've built and used in the past often had a number of non-C components (mostly Perl, as it was 10+ years ago), for health checks, data gathering, making balancing decisions, etc. It is entirely possible this is the kind of work Go is doing (again, I haven't looked deeply into the code...but, I don't immediately see anything indicating Go is doing the actual load balancing, but it is obviously doing health checks and providing management access).
Finally, Erlang is a garbage collected language, and yet it has been used for a couple of decades for this kind of workload. So, evidence strongly suggests it is possible for a GC language to do things like this (though, again, I don't think Go is doing the network layer work here, since LVS is in the picture).
Garbage collection in Go can't be implemented the same way, because Go allows for shared mutable state.
That said, the work done to the GC in Go v1.5 seems quite phenomenal, but just because the two runtimes share a piece of terminology called "garbage collector", they're very, very different in terms of the semantics and effects exposed.
[1] https://groups.google.com/forum/#!msg/golang-codereviews/m5Q... [2] https://tip.golang.org/doc/go1.6