code

code

How to build a loadbalancer using elixir?

What I want to know is whether I can use elixir to build a load balancer that receives the requests of the user and then sends a messages to the processes that handles the users in order to know which one is the least busy, and depending on the result, the load balancer(which is a process itself) redirects the user and in the process eliminating third party load balancers such as nginx.

Most Liked

hauleth

hauleth

You can, however depending on your needs Elixir may be not the best choice for such low-level infrastructure component as it may introduce too much latency. In general such adaptive load balancing isn’t common, as it is often much quicker to use simpler strategy for load balancing (least recently used, RR, random, etc.). The reason for that is that defining “least busy” is quite complex task on it’s own.

Exadra37

Exadra37

To me the title and the description of your topic are not in sync.

To me configuring a server to run an application is different from putting a load balancer in front of the application, but I may be wrong.

You may want to explain with more detail what you are trying to achieve. To me it looks that you are asking how to create an Elixir load balancer that is able to balance requests between nodes in a distributed application. Am I correct?

Exadra37

Exadra37

I wondered that myself several times and never took the time to do a deep research, but I know some exist already, like:

https://github.com/Charlyzzz/Adrestia
(not maintained)

You can also read this chapter to have more insights on what you want:

Where Next?

Popular in Questions Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42716 114
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement