A Load Balancer from scratch - Liz Rice, Isovalent

Поділитися
Вставка
  • Опубліковано 15 січ 2025

КОМЕНТАРІ • 31

  • @GlassFamFishing
    @GlassFamFishing 2 роки тому +4

    I’ve watched this a few times now. It was great and was a huge help for me getting started with my XDP/BPF adventures.

  • @sandeepkulambi7924
    @sandeepkulambi7924 11 місяців тому +1

    Excellent video, packing wealth of information in 17mins.

  • @dincerbeken5761
    @dincerbeken5761 Рік тому +2

    absolutely fantastic

  • @peterkipkoech2882
    @peterkipkoech2882 2 місяці тому

    Simply amazing. Trying this out

  • @DucNguyen-l7f
    @DucNguyen-l7f 4 місяці тому +1

    IT WAS ACTUALLY AMAZING, KEEP ON THE GOOD WORK
    FROM A STUDENT FROM VIET

  • @ahahTl
    @ahahTl 2 роки тому +2

    Very interesting and helpful. thank you.

    • @eBPFCilium
      @eBPFCilium  2 роки тому

      We are glad you like it :)

  • @malbolgee
    @malbolgee 2 роки тому +3

    Amazing! Is it possible to redirect TCP paackets from a port X to another port Y in the same machine using eBPF?

    • @eBPFCilium
      @eBPFCilium  2 роки тому

      Yes, you could have an XDP program that checks if the packet is TCP, then updates the port before directly in the packet before it reaches the kernel stack

  • @DanCave
    @DanCave 3 роки тому +4

    This is very cool.. I had often wondered how difficult it would be to do this in code.
    I am presuming that writing the same code using GoLang would be similar and easier?

    • @lizrice_
      @lizrice_ 3 роки тому +3

      The golang compiler doesn't currently support building BPF objects - at the moment the choices are C and (pretty recently) Rust. (I'd imagine that it would be a challenge to get Go's runtime past the eBPF verifier, too.)

    • @omarmihilmy
      @omarmihilmy 3 роки тому

      @@lizrice_ but you should be able to attach the complied BFP XDP program from the Go user space to the netlink socket?

    • @kamran1992
      @kamran1992 2 роки тому

      Diplomatic

  • @46september
    @46september 8 місяців тому

    I understand that this a basic implementation, but for a large HTTP request, do we not need to forward all the packets to the same backend ?
    With this implementation, it will randomly distribute packets among the backends. So we need some stickiness to map a particular HTTP request to a particular backend server.

  • @TianLi-q5v
    @TianLi-q5v Рік тому

    Can I use iph_csum to recalculate the ICMP/TCP/UDP's checksum?

  • @kafirboysrock
    @kafirboysrock 5 місяців тому

    Which ide is this?

    • @LnX53
      @LnX53 5 місяців тому +1

      visual studio code

  • @dces4212
    @dces4212 3 роки тому

    15:15 It seems that the long waiting for reply is caused by packet being unintentionally dropped. Does anyone know the root cause of this? Thanks!

    • @aarondesouza75
      @aarondesouza75 2 роки тому +4

      I believe this is caused by the simple load balancing algorithm that is being used (remember it's only a demo). The algorithm decides which backend to send a packet to based on the time the packet is being processed. So imagine when the client makes it's request, it starts by sending a SYN which is forwarded by the load balancer to, say, backend A. Backend A will send a SYN-ACK which the load balancer will forward to the client. The client will then respond with an ACK. Now depending on the time the load balancer processes this packet it may send it to backend A or backend B, if it decided to send it to backend B then the TCP connection won't have been established and retransmissions will occur. The same when the client sends the HTTP request, it may go to backend A or backend B.

    • @QueLastima
      @QueLastima 2 роки тому

      @@aarondesouza75 Do people really need to code at this level anymore? It's interesting, but I wouldn't want to start writing a load balancer.

    • @GlassFamFishing
      @GlassFamFishing 2 роки тому

      @@QueLastima it just depends on what you are into. There are several people still coding at this level building on top of current load balancers or working on building “better” ones that implement various integrations that their company may need or would like.

    • @GlassFamFishing
      @GlassFamFishing 2 роки тому

      @@QueLastima if you look at libbpf, people are updating that all the time. And that was built to try and make bcc more portable.

  • @perfectalgos9641
    @perfectalgos9641 3 роки тому

    Can you please share the code or repo?

    • @eBPFCilium
      @eBPFCilium  3 роки тому +1

      It's here: github.com/lizrice/lb-from-scratch

  • @QueLastima
    @QueLastima 2 роки тому

    This was made in... 2021. ...And you need to code a load balancer in C?
    Something is terribly wrong here.
    Aren't there already mature tools for this? Ugh.

    • @LizRice
      @LizRice 2 роки тому +6

      This is a demonstration to illustrate eBPF / XDP - it's not intended to be a production-ready tool!

    • @GlassFamFishing
      @GlassFamFishing 2 роки тому +2

      I like c. I don’t see anything wrong with using it to write a load balancer. Especially since you are looking for speed.

    • @QueLastima
      @QueLastima 2 роки тому +1

      @@LizRice Noted. Sorry - it is an interesting exercise.

    • @QueLastima
      @QueLastima 2 роки тому +1

      @@GlassFamFishing It is an interesting exercise, but I'd be really wary of putting my own load balancer in a production environment I cared about without a lot of QA testing.

    • @ChuppaChuck
      @ChuppaChuck 9 місяців тому +2

      Load ballancers are not the only use for EBFs... It's just an example to show what you can do with EBF running in the kernel