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

4.x: Additional CQv2 message store optimisations #11112

Merged
merged 4 commits into from
Jun 17, 2024

Conversation

lhoguin
Copy link
Contributor

@lhoguin lhoguin commented Apr 29, 2024

Planning to include these for 4.0.

@essen essen force-pushed the loic-faster-cq-shared-store-gc branch from b2f11a2 to 66ad60e Compare April 29, 2024 08:48
@michaelklishin michaelklishin changed the title CQ: Additional message store GC optimisations DO NOT MERGE 4.x: DO NOT MERGE Additional CQv2 message store GC optimisations Apr 29, 2024
@lhoguin

This comment was marked as outdated.

@essen essen force-pushed the loic-faster-cq-shared-store-gc branch from 66ad60e to 7427cfe Compare May 2, 2024 09:36
@lhoguin

This comment was marked as outdated.

@essen essen force-pushed the loic-faster-cq-shared-store-gc branch from 4351976 to 84695ff Compare May 6, 2024 15:49
@lhoguin
Copy link
Contributor Author

lhoguin commented May 6, 2024

The first commit greatly improves dirty recovery times. On my machine, with data that's 24 million messages spread over many files and two queues, node recovery goes from 4min30 to less than 2min. The problem was that the old code was gathering messages from queues one by one (meaning 3 or 4 Erlang messages per AMQP message!!). Now it does so per segment file.

There are still parts that could be improved for making dirty recovery blazingly fast but they require storing additional state on disk and so will not be investigated fully for now.

@essen essen force-pushed the loic-faster-cq-shared-store-gc branch 2 times, most recently from 07be784 to fbf11f5 Compare May 7, 2024 10:46
@lhoguin lhoguin changed the title 4.x: DO NOT MERGE Additional CQv2 message store GC optimisations 4.x: Additional CQv2 message store optimisations May 7, 2024
@lhoguin lhoguin marked this pull request as ready for review May 7, 2024 12:09
@lhoguin

This comment was marked as outdated.

@michaelklishin michaelklishin added this to the 4.0.0 milestone May 7, 2024
@lhoguin

This comment was marked as outdated.

@essen essen force-pushed the loic-faster-cq-shared-store-gc branch 2 times, most recently from fd3a118 to 817c59e Compare May 14, 2024 14:57
@essen essen force-pushed the loic-faster-cq-shared-store-gc branch 3 times, most recently from d8a5536 to 0575002 Compare May 16, 2024 09:20
@lhoguin

This comment was marked as outdated.

@lhoguin

This comment was marked as resolved.

@essen essen force-pushed the loic-faster-cq-shared-store-gc branch from 0575002 to fa4e1ad Compare June 10, 2024 13:28
@essen essen force-pushed the loic-faster-cq-shared-store-gc branch 2 times, most recently from 0720633 to 001cc83 Compare June 11, 2024 13:19
lhoguin and others added 3 commits June 14, 2024 11:52
This only applies to v2 because modifying this part of the v1
code is seen as too risky considering v1 will soon get removed.
It will always use the ETS index. This change lets us
do optimisations that would otherwise not be possible,
including 81b2c39.

A small functional change is included in this commit:
we now always use ets:update_counter to update the
ref_count, instead of a mix of update_{counter,fields}.

When upgrading to 4.0, the index will be rebuilt for
all users that were using a custom index module.
It is no longer needed as only a single module uses it.
@essen essen force-pushed the loic-faster-cq-shared-store-gc branch from 001cc83 to cc73b86 Compare June 14, 2024 09:52
@lhoguin
Copy link
Contributor Author

lhoguin commented Jun 17, 2024

@mkuratczyk did a benchmark and a few checks to see that this PR works as intended. Merging, thanks!

@lhoguin lhoguin merged commit d959c8a into main Jun 17, 2024
329 checks passed
@lhoguin lhoguin deleted the loic-faster-cq-shared-store-gc branch June 17, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants