Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decay should be a behaviour #8

Open
jaynel opened this issue Sep 26, 2014 · 0 comments
Open

Decay should be a behaviour #8

jaynel opened this issue Sep 26, 2014 · 0 comments

Comments

@jaynel
Copy link
Member

jaynel commented Sep 26, 2014

The current decay approach is not really decay, it is just a random probability of failure on check in expressed as number of chances of dying per 1M uses. Decay should really be an exponential increase in probability of failure, triggered by some measure of use or likelihood of the process causing problems if it isn't recycled. The key is to make the results stochastic so that there is a very, very low probability of a storm of connections be reset at the same time.

Death of a connection serves two purposes:

  1. It frees fragmented heap and removes any leftover process dictionary junk
  2. It allows the respawn + reconnect to attach to a different node for better load balancing
    - the most beneficial aspect is when a faulty node cannot be reconnected

There are a few methods for having a smarter decay factor:

  1. Base it on reductions of the process
  2. Base it on memory allocations or garbage collect cycles
  3. Allow the integrator to define an application specific function

Creating a behaviour with default functionality base on reductions as a default, with the application able to override would be a good improvement over the current state of affairs. The information passed on the decay function call is currently just the Pid. I'm not sure what additional information is available in Elysium that would be useful. The application could implement a dictionary of Pids that are currently active and log information about what tasks they've performed (although it is fairly opaque when a particular session gets used).

jaynel pushed a commit that referenced this issue Nov 10, 2014
Handle missing_ets_data on pending request execution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant