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:

(not maintained)

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

code

code

Thanks for pointing out the confusion, gonna edit the post.

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.

Where Next?

Popular in Questions Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
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
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New

Other popular topics Top

pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement