Skip to content

Instantly share code, notes, and snippets.

@etrepum
Last active December 17, 2015 19:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etrepum/5664126 to your computer and use it in GitHub Desktop.
Save etrepum/5664126 to your computer and use it in GitHub Desktop.
gproc notes

TL;DR: gproc probably isn't what you need, but OTP's global module will probably work fine.

gproc 1 has a module gproc_dist that uses gen_leader 2 for coordination, no mnesia is involved. Some of the details for how it was originally designed are in Ulf's paper on it 3.

The significant disadvantages are:

  • The node list by default must be static and known at start time! This will make expanding the cluster a non-starter without changes to gproc and/or gen_leader. There appears to be some experimental/undocumented way to expand a cluster that might work 4
  • There might be incorrect logic for net-splits (either detection or resolution) 5

There doesn't appear to be a better global process registry available. The only other one I was able to find easily was ngproc 6 which suffers from the same sort of limitations and doesn't seem to be actively maintained.

My recommendation for now is to OTP's global 7 module. There are downsides to this too, but I think it will probably work best for your use case in the short to medium term. Make sure to read through the docs there pretty carefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment