sean.mccauliff
Hi I’m completely new to Elixir and Erlang. I was reading the documentation at https://elixir-lang.org/getting-started/introduction.html and was wondering about some details around processes which is the most interesting feature of Elixir (to me).
What are the patterns around dealing with busy processes? If calls to send can never block how can a sender detect if a process is busy? Is there a way to rate limit sender? What happens if the receiver never calls receive does memory just fill up?
Thanks
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
cmkarlsson
Generally you can’t or don’t. You use other mechanisms to handle overload([2]).
Yes. The mailbox of the process fills up and eventually you run out of memory.
Two links which explains a bit about erlang/elixir scheduling and how to handle overload of unbounded mailboxes.
[1] JLOUIS Ramblings: How Erlang does scheduling
[2] Handling Overload
tty
Typically a process that is expected to receive heavy messages does not perform any work, instead it would spawn Tasks to handle each as it comes in. The current default limit for processes is 262144, and this is configurable. Use processes.
You would limit rates if and only if you are trying to access some critical resource, in which case put a buffer (bit-bucket / queue) in between. Usually this means using ets or mnesia or RabbitMQ as a holding area for messages.
outlog
what problem are you solving?
usually you would use a genserver - and the call would have timeout 5 secs by default..
also look at GenStage for back pressure/rate limiting etc..
but all depends on the actual problem that is being solved..
OvermindDL1
Plus if a process’s mailbox is pretty full then it ‘slows’ down sending to it more and more the more full it is, so a process sending a message to it will be ‘back-pressured’. This doesn’t help if it’s a new process sending a new message every time but it helps throttle the system under most loads.
But ‘OTP’ is the main pattern used to manage processes, and there is a lot built up on it.
Qqwy
It’s also important to note that:
Even if this (e.g. a process in an infinite loop) happens, it will not immediately bring down your system, because of the pre-emptive scheduling of the BEAM VM.
You can easily see that a process is broken by using tools such as
:observerwhenever you are awake and looking at your system again, then figure out what is going on, fix it and hot-upgrade the system without causing any downtime.I can really recommend the talk Solid Ground by Sasa Juric, where he gives more info, and live creates, introspects and fixes a ‘broken’ process!
sean.mccauliff
Thanks for all the replies. You have given me much to think about.
idi527
Not anymore, I think. It’s been removed in either v20 or v21.
Some more (quite enlightening) discussion about it.
OvermindDL1
Interesting! I did not know about that! Thanks!