TOPIC: #weavenetwork Weave - the Docker network - http://weave.works/ http://blog.weave.works/ | talk to us here or look at http://weave.works/help/ for links to the mailing list and other support channels | channel logs - https://botbot.me/freenode/weavenetwork | latest release is 1.3.1 - https://github.com/weaveworks/weave/releases/tag/v1.3.1
errordeveloper joined the channel
ofthecure joined the channel
errordeveloper joined the channel
d4nH96 joined the channel
d4nH96
Hello, can somebody help me with a problem? :)
It's about the load balancing tutorial with Weave Run
bryanb
Hi, what's up?
d4nH96: what problem did you run into?
d4nH96
I did every step of the tutorial, but the loadbalancing is simply not working. The weave dns status looks fine. :/
bryanb
not working meaning no requests are served, or they are served in a non-balanced way?
d4nH96
It is balancing, but not between both hosts. Only on the host where i start the curl requests.
The tutorial says, it should balance between both :/
It looks like musl, the library used in things like busybox, now also sorts the results.
Weave currently does not present you with any options to change what it returns, so in that sense there is no fix.
It wouldn't be hard to change it to return, say, just one of the N addresses, but then this is worse for resiliency.
d4nH96
Ok. Thanks for the fast help,otherwise I would have tried it for hours to get it working.
So If I want to loadbalance between two hosts, what are my options now? NGINX?
moonfish
you *can* load-balance between several hosts.
just not when one of those hosts is the same as the client's.
bryanb
It's more complicated than that
moonfish
yes, sorry.
bryanb
It depends how the addresses have been allocated, bit-wise
In a situation where your addresses are quite sparse this will tend to map onto hosts, but that's not guaranteed.
(I'm speaking here about the specifics of weave's address allocator)
moonfish
one reliable way to load balance between several hosts is to do your own dns resolution.
or, say, take the result of getaddrinfo() and permute it randomly.
d4nH96
ok, that is way more complicate than I thought
bryanb
d4nH96: yes. we're working on more useful load-balancing, at the IP level, but that isn't something you can try out yet.
d4nH96
That sounds great, so this feature will appear on of the next updates?
in one*
moonfish
or you could use gethostbyname().
do you know how your clients resolve addresses?
d4nH96
No, I have not much knowledge in all those "address-things", that is why I was so interested in the load-balancing with weave, because it sounds so easy compared to other methods.
moonfish
how important is resilience to you?
d4nH96
We would use this for our mobile payment servers, so resilience is very important.
moonfish
so you need a guarantee that if you have N service instances, and just one of them is reachable, that clients will still be able to connect?
bryanb
The only thing we can really do in the DNS server is to randomly omit some of the responses, so your client isn't always sorting the same set of addresses and choosing the same one. But as @moonfish is hinting, to do so will reduce the effective redundancy.
d4nH96
Exactly @moonfish.
bryanb
If you had, say, 10 instances of the service, and we returned 5 of them, chances are pretty good that you'll still find one that works.
But "pretty good" isn't the same as "a guarantee"
d4nH96
When I really want to force to load-balance between two hosts with round robin algorithm, to ensure that at no point one host is overloaded, is there any chance to realize it in an easy way with weave?
bryanb
Well, we can do that with a small code change to return 1 of the 2 addresses each time, but if that one has just crashed then your call will fail.
Hence the discussion about resilience.
d4nH96
Ok. I noticed that, so thanks for your fast help and keep it going guys. :)
And sorry for my "bad english", I am from Germany :D