Re:Unpacking Elixir: Real-Time and Latency
by mikhailfranco on Sunday September 10, 2023 @10:21AM
(#37456030)
It is good practice for (soft) realtime systems to keep data messages under the Ethernet MTU of ~1500 bytes.
This especially applies to UDP, Erlang and any other distributed computing system.
Send many small non-blocking notification messages, usually delta state, not huge blocking RPC data structures.
It's not that hard to accidentally exhaust the thread pool of some runtimes whereas you have to end up in pretty deep pathological areas in Erlang in order to do so. Notably `term_to_binary` on massive structures has historically been mis-bookkept (if you can call it that) by the runtime and will only count as one function call despite its high cost. This means the scheduler can't preempt it and wouldn't be able to nicely schedule N processes (where N is the amount of schedulers you have currently running, i.e. usually your core count) that were executing it.
But again, these are much deeper pathological cases than you'd find causing issues in most runtimes.