drewble
With several Phoenix apps clustered with libcluster, it’s easy to make calls to remote nodes via :erpc.
Say I have two different public-facing apps, and one needs to fetch data from the other to serve requests. Is it a reliable pattern to use :erpc for this relationship? Are there known limitations or performance hits for concurrent requests over :erpc?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
Hello,
I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
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
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 8- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
D4no0
To be fair I’m not a big fan of doing rpc calls without a predefined contract, that can be enforced on both ends, it is just too easy to break the contract by accident.
IMO a monolith that has good separation of code will be times more easier to manage than those 2 separate services trying to communicate via rpc.
drewble
The plan is to define a tested and documented API for use by
:erpccalls for exactly that reason. We have domain reasons for maintaining separate apps.Architectural concerns aside, are there known limitations or performance hits for concurrent requests over :erpc?
D4no0
Have you read the introduction paragraph for erpc? I guess this is an important pointer that is presented there: Processes — Erlang System Documentation v29.0.2
tj0
I’ve only used :rpc (or software that used rpc, erpc looks like a newer version) and I’ve never really hit limits on this. The situation was:
I don’t think there’s any reason not to use it? The alteratives aren’t that great either. Spending cpu serializing/deserializing json over http? After seeing 25% of the cpu going to parsing, deciding to go to a binary format like messagepack? As long as everything is trusted, single datacenter, and no reason to talk to non-BEAM languages, why not use the standard protocol? For instance, I never had any issues with riak clusters and I can’t think of any application that would be more chatty.
Then on modern hardware, I don’t think it will be very easy to hit the limits. Anyway, for further information:
Personally, I would be more concerned about security and the introduction of other languages than the scale in most situations.
drewble
@D4no0 I have read the introduction paragraph. I have also read the note about blocking signals, although I can’t say I totally understand it.
@tj0 there is a line in the introduction to
:erpcthat says it “has better performance and scalability than the original rpc implementation” but with no implementation details. Based on the paper you linked, it appears even the original:rpcwould be scalable enough for our current needs. It’s good to know thatNode.spawn/4is there if we do hit some of those bottlenecks.drewble
Looking into this more,
erpcis significantly different thanrpc. The issue that is commonly raised is that the originalrpcimplementation relied on a single GenServer process namedrexto handlerpccalls. This causes performance degradation under high call volumes due to mailbox flooding. The charts in the DE-Bench PDF above indicate that usingspawninstead ofrpcis not subject to the same limits, as it spins up a new process per-call.erpcbasically builds the alternative approach into the Erlang kernel, usingspawn_requestto make that actual request to the remote node as mentioned in the Kernel 7.0 release notes and found in the Erlangerpcimplementation.rexis entirely absent from the:erpcimplementation, andrpcitself now relies onerpcfor many operations, likely for this reason.The theoretical limitations of
erpcmay be the port blocking described in thegen_rpclibrary README. For the purposes of usingerpcto make intra-cluster API calls with reasonably sized response payloads, this is probably not an issue.julismz
You could face this with structs or even with Apache AVRO’s schemas, couldn’t you?
Sanjer
Thanks @drewble for this.
I am exploring to build a highly concurrent request-response system, using new erpc. Your findings helps me, get guided into right direction.
Any lessons learnt, if you have used erpc already in production.
If you could share, which may help us?