Re: Question about Maglev algorithm

2018-12-29 Thread Valentin Vidic
On Sat, Dec 29, 2018 at 06:03:51PM +0100, Aleksandar Lazic wrote:
> I thought I have misunderstood the Idea behind maglev, thanks for 
> clarification.

Found another mention of Maglev [Eis16] for high-level load balancing (between
datacenters):

  https://landing.google.com/sre/sre-book/chapters/load-balancing-frontend/

-- 
Valentin



Re: Question about Maglev algorithm

2018-12-29 Thread Aleksandar Lazic
Am 29.12.2018 um 07:41 schrieb Willy Tarreau:
> On Fri, Dec 28, 2018 at 07:55:11PM +0100, Aleksandar Lazic wrote:
>> Well as far as I understood the pdf one of the biggest difference is that
>> Maglev is a distributed system where the consistent hash is for local system.
> 
> No, not at all. The difference is that it's designed for packet processing
> so they have to take care of connection tracking and per-packet processing
> cost. From what I've read in the paper, it could be seen as a subset of
> what we already do :
>   - server weights are not supported in Maglev (and very likely not needed)
>   - slow start is not supported
>   - server insertion/removal can be extremely expensive (O(N^2)) due to the
> way they need to build the hash table for fast lookup
>   - no possibility for bounded load either
> 
> It's really important to understand the different focus of the algorithm,
> being packet-oriented instead of L7-oriented. This explains a number of
> differences and choices. I think Maglev is excellent for what it does and
> that our mechanism wouldn't be as fast if used on a per-packet basis. But
> conversely, we already do the same and even much more by default because
> we work at a different layer.

I thought I have misunderstood the Idea behind maglev, thanks for clarification.

> Willy

Cheers
Aleks



Re: Question about Maglev algorithm

2018-12-28 Thread Willy Tarreau
On Fri, Dec 28, 2018 at 07:55:11PM +0100, Aleksandar Lazic wrote:
> Well as far as I understood the pdf one of the biggest difference is that
> Maglev is a distributed system where the consistent hash is for local system.

No, not at all. The difference is that it's designed for packet processing
so they have to take care of connection tracking and per-packet processing
cost. From what I've read in the paper, it could be seen as a subset of
what we already do :
  - server weights are not supported in Maglev (and very likely not needed)
  - slow start is not supported
  - server insertion/removal can be extremely expensive (O(N^2)) due to the
way they need to build the hash table for fast lookup
  - no possibility for bounded load either

It's really important to understand the different focus of the algorithm,
being packet-oriented instead of L7-oriented. This explains a number of
differences and choices. I think Maglev is excellent for what it does and
that our mechanism wouldn't be as fast if used on a per-packet basis. But
conversely, we already do the same and even much more by default because
we work at a different layer.

Willy



Re: Question about Maglev algorithm

2018-12-28 Thread Aleksandar Lazic
Well as far as I understood the pdf one of the biggest difference is that 
Maglev is a distributed system where the consistent hash is for local system.

What I think is if consistent hash uses the peers table for balancing it could 
be similar to Maglev, but I'm not a algo expert, just an Idea.

I don't know if it's have any benefits for haproxy, I have seen this algo on 
envoy site and wanted to know what the experts here means about it :-)

https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/load_balancing/load_balancers

Regards
Aleks


 Ursprüngliche Nachricht 
Von: Aaron West 
Gesendet: 28. Dezember 2018 19:36:03 MEZ
An: HAProxy 
Betreff: Re: Question about Maglev algorithm

I've not used it yet with IPVS because I have nothing with a new enough
Kernel (4.18+ I think), however, isn't this quite similar to HAProxy's
consistent hash options?

Aaron
Loadbalancer.org


Re: Question about Maglev algorithm

2018-12-28 Thread Aaron West
I've not used it yet with IPVS because I have nothing with a new enough
Kernel (4.18+ I think), however, isn't this quite similar to HAProxy's
consistent hash options?

Aaron
Loadbalancer.org


Re: Question about Maglev algorithm

2018-12-28 Thread Valentin Vidic
On Fri, Dec 28, 2018 at 07:11:24PM +0100, Aleksandar Lazic wrote:
> Have anyone take a look into the Maglev algorithm ?
> 
> This paper looks very interesting 
> https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/44824.pdf

Seems to be in IPVS already:

https://github.com/torvalds/linux/blob/master/net/netfilter/ipvs/ip_vs_mh.c

-- 
Valentin



Question about Maglev algorithm

2018-12-28 Thread Aleksandar Lazic
Hi.

Have anyone take a look into the Maglev algorithm ?

This paper looks very interesting 
https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/44824.pdf

Regards
Aleks