Skip to content

Use write_concurrency: :auto for default ETS storage#68

Merged
rkallos merged 1 commit intorkallos:mainfrom
v0idpwn:write-concurrency
Feb 24, 2026
Merged

Use write_concurrency: :auto for default ETS storage#68
rkallos merged 1 commit intorkallos:mainfrom
v0idpwn:write-concurrency

Conversation

@v0idpwn
Copy link
Copy Markdown
Contributor

@v0idpwn v0idpwn commented Feb 24, 2026

On my benchmarks, provides a 15% improvement. It's generally
recommended:

The auto alternative for the write_concurrency option is similar
to the true option but automatically adjusts the synchronization
granularity during runtime depending on how the table is used.
This is the recommended write_concurrency option when using
Erlang/OTP 25 and above as it performs well in most scenarios.

On my benchmarks, provides a 15% improvement. It's generally
recommended:

>The auto alternative for the write_concurrency option is similar
>to the true option but automatically adjusts the synchronization
>granularity during runtime depending on how the table is used.
>This is the recommended write_concurrency option when using
>Erlang/OTP 25 and above as it performs well in most scenarios.
@rkallos
Copy link
Copy Markdown
Owner

rkallos commented Feb 24, 2026

TIL that write_concurrency: true has worse scalability with # of processes than I thought.

Official benchmarks: https://www.erlang.org/bench/ets_bench_result_lock_config

That page shows a relatively narrow performance gap on read-only workloads that widens and widens as write percentage increases. Seeing as Peep is very write heavy, I guess this change is no-brainer.

Would it be possible for you to share your benchmark code? I do believe the results you're seeing, but I am slowly trying to collect a little suite of Peep benchmarks.

@hauleth
Copy link
Copy Markdown
Contributor

hauleth commented Feb 24, 2026

I think that @v0idpwn is using similar test suite as I am - Supavisor. I have some benchmark files written for testing small things, but these do not test Peep in "real life" scenarios under heavy load. Maybe there could be something done similar to that what could simulate such heavy load.

@rkallos
Copy link
Copy Markdown
Owner

rkallos commented Feb 24, 2026

Gotcha. I'll probably set up a little benchmarking suite inside/alongside Peep 'someday'. In the meantime, I also have real software using Peep 'at scale' where big performance wins can be easily seen.

@rkallos rkallos merged commit 7617e6e into rkallos:main Feb 24, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants