anuaralfetahe
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. Each cluster initiates its own hub under the supervision tree, and all these hubs collectively form a cluster.
Drawing inspiration from frameworks like Horde and Swarm, one of the primary motivations behind developing this library was the necessity to replicate processes in order to enhance reliability.
This library was originally a component of another project and was tightly integrated with it until it grew and I made the decision to open source it and extract it from the codebase.
Please be caution when using this library, as it is currently in an alpha release phase.
Key Features:
Cluster Distribution: ProcessHub allows you to effortlessly distribute processes across a cluster of nodes.
Configurable Strategies: Tailor your distribution strategies to your specific needs. ProcessHub offers a range of strategies for redundancy handling, process replication, network failure mitigation, and more.
Scalability and Availability: Designed with scalability and availability in mind, ProcessHub’s operations are predominantly asynchronous and non-blocking. It’s eventually consistent.
Decentralized Architecture
React to events : ships with a set of events that can be hooked into and trigger code.
Theres actually much more. Please read the documentation.
Link to the documentation: Hex
Github: Repo
Thanks ![]()
Trending in Announcing
Other Trending Topics
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 49 to 40- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
anuaralfetahe
New version released
0.7.0The license has changed from GPL-3.0 to Apache-2.0 to make adoption easier.
Alost includes a bug fix where a race that lost the result of
awaitable: trueoperations, reported and fixed by @slouchpie thank you!Recovery (still experimental) got a big rework. Children started with
durable: truego into a cluster wide list that every node keeps the cluster in line with, so a full outage recovers on its own while a single node rejoining won’t restart what’s already running. A custom storage options added.Link to the changelog: Release v0.7.0 · alfetahe/process-hub · GitHub
anuaralfetahe
New version released
0.6.0yes, the beta tag is officially gone!The library has been in use for some time now and has been stable. While I still have many ideas for new features, the core functionality and public API will likely stay as they are unless there is a clear need to change them.
In the future, I will keep releasing new features, and some will be marked as experimental just as I’ve done so far. If these features stand the test of time and prove useful, they will become part of the stable core.
Here’s the changelog:
anuaralfetahe
New version release
0.5.0-betaThis one includes many performance optimisations, bugfixes, new features, some breaking changes and large scale code refactoring.
You can look at the changelog here: Release v0.5.0-beta · alfetahe/process-hub · GitHub
I have a lot of ideas and features I’d like to add to this library, but I also want to prioritize stability. In this release, I’ve marked several new features as experimental. This means they may undergo breaking changes or be dropped entirely in future updates.
Here are some performance benchmarks comparing this version and the previous one starting and stopping 10k processes on 10 nodes (running on the same machine).
I used the same laptop to run the tests.
The new version is up to ~10x faster then the previous one and uses ~2x less memory.
This is ~250ms to start and stop 10k processes on 10 nodes.
Host:
Operating System: Linux
CPU Information: 13th Gen Intel(R) Core™ i7-13700H
Number of Available Cores: 20
Available memory: 62.43 GB
Elixir 1.19.3
Erlang 28.1.1
JIT enabled: true
v0.5.0-beta
v0.4.1-beta
anuaralfetahe
Sorry for the late reply.
I don’t know your exact requirements but in general you should be able to do it.
ProcessHub takes care of restarting the children on the new node automatically.
In case you need to handover the process states before terminating them on the old node you can use either `ProcessHub.Strategy.Migration.HotSwap` or `ProcessHub.Strategy.Migration.ColdSwap` migration strategies with `handover` option. In this case you need to do graceful shutdown on the nodes so they have enough time to pass the states to the new node. You can use `System.stop()`.
lawik
Just FYI, ProcessHub is used in NervesHub which means it is used for some reasonably large deployments. Several 100K devices connected to double digit nodes in some installs.
Don’t think we’ve had any issues. I haven’t worked on that part so much but seems like a clean solution.
We use it for a fairly simple thing. Important but not intense. Make sure we run one orchestrator process for distribution of firmware updates per deployment group im the cluster. The orchestrator keeps tabs on the number of concurrent updates and stuff. Tells other processes what to do.
Though that might be of interest
jhosteny
This is a nice library. I am looking to see if it will work well with rolling deploys in AWS ECS.
anuaralfetahe
New version release
0.4.0-betaThis new release delivers bug fixes, improvements, and new features. The highlight is the introduction of enhanced formatting options with Future.await, providing more powerful result handling capabilities:
Starting and stopping processes — ProcessHub v0.5.0-beta .
Additionally, this release includes some deprecations and introduces an innovative distribution strategy that intelligently distributes processes based on real-time node load:
ProcessHub.Strategy.Distribution.CentralizedLoadBalancer — ProcessHub v0.5.0-beta . Please note that this load balancing feature is currently experimental, with further enhancements planned for the next release.
anuaralfetahe
I’m considering adding a more dynamic approach to process distribution.
Currently, the main strategy is based on consistent hashing, meaning all nodes agree on the distribution without requiring a master or coordinator node. This works well, but it’s currently not possible (without using workarounds) to alter the distribution dynamically. We do have the guided distribution strategy, but it lacks features like automatic migration and other flexibility.
The idea is to create a new distribution strategy—ideally built on top of guided distribution—that allows users to define their own callbacks for selecting preferred nodes, instead of relying solely on automatic assignment via a hash ring. This approach would likely require one central or master node within the cluster.
My personal use case for this would be to distribute processes based on BEAM or system load, allowing processes to be placed on nodes with lower current load, for example.
If anyone has ideas or relevant experience, I’d love to hear your thoughts!
anuaralfetahe
New version release
0.3.3-alphaanuaralfetahe
New version released
0.3.2-alpha