persistent_term to replace ETS for caching
Nalin Ranjan
ranjanified@REDACTED
Sun Dec 6 11:41:22 CET 2020
It has the potential to trigger Global GC, and can affect responsiveness as
per the docs.
https://erlang.org/doc/man/persistent_term.html
Regards
Nalin Ranjan
On Sun, Dec 6, 2020 at 5:16 AM Frank Muller <frank.muller.erl@REDACTED>
wrote:
> Hi guys,
>
> At work, we cache about 5.3 million entries in ETS. The system works
> perfectly, no issue so far (many years).
>
> During a brainstorming session, a colleague suggested to switch to
> persistent_term instead to avoid ETS term copying.
>
> Pretty simple: we check if the Key exists in persistent_term. If yes, we
> are done. If not, we get it from ETS, move it to persistent_term and send
> it back to the caller.
>
> Question: is there any limitation(s) on persistent_term usage? Stated
> otherwise, can we create 5.3 million persistent_term <K,V>?
>
> Any suggestion/idea/thought is very welcome.
>
> /Frank
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20201206/1063e964/attachment.htm>
More information about the erlang-questions
mailing list