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











First Post!- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
anuaralfetahe
New version released.
v0.1.1-alpha - 2023-10-07
Elixir 1.13-1.15 support added.
Includes minor bugfixes, test fixes and documentation updates.
Added
ProcessHubis compatible with Elixir 1.13-1.15.Changed
ProcessHubdocumentation by adding a list of all available strategies.Fixed
ProcessHubawait/1 function example code formatting.The library is still in the alpha phase, feedback and suggestions are welcome. If you have any issues, please open an issue or a pull request on Github.
Most Liked
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
slouchpie
I started exploring this library a few hours ago and it is extremely good. I have used
hordein the past andpogomore recently. Both of those libs are great butprocess_hubis truly a joy to use.There is a lot to love and I have not even started using the hot-swapping and hooks stuff. Reading the list of hook events blew my mind. My imagination was piqued.
I love the simplicity of the
hub_idatom. This plays well with Fly because the fly region can be used to build the hub_id, for simple per-region clustering.I also love the way you use local ETS tables for fast lookup. Perfect use-case for ets.
I am still doing a refactor on a feature branch to see if my own hacky
:pogo-based attempts at distributed process management can be replaced with:process_hub. So far I refactored a cache for oauth “state” and a per-kitchen “global singleton” order number generator process. I have way less LOC already and it is far simpler to read and understand.I am in awe. Congratulations.
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
Last Post!
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