[erlang-questions] Request for opinions on using process dictionary for meta information

Jay Doane jay.s.doane@REDACTED
Mon Apr 17 22:43:06 CEST 2017


Our team is currently using the process dictionary to store meta
information for long running processes, and would like to hear from folks
familiar with beam internals whether this is a recommended practice.

Essentially we add meta information about the current request in a process
dictionary of every process related to handling of this request. This
information could be:
- current file
- user name of initiator of the request
- http query parameters
- type of a process (indexer | compactor | http_handler)

For example, when we detect performance problems, we run a function that
returns the Pids of (say) top memory using processes. We use the meta info
stored in process dictionaries to determine which documents are using
excessive memory so we can take corrective action.

In practice, we are unable to use normal OTP messaging because in many
cases, the high memory using processes have also grown huge message queues,
and so would be unresponsive to any additional messages.

Given our existing constraints, is this a reasonable use of the process
dictionary?

Thanks,
Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170417/fd676385/attachment.htm>


More information about the erlang-questions mailing list