-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
CQ shared store write optimisations #8507
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Before they would only be sent periodically or when rolling over to a new file.
We know the messages are on disk or were acked so there is no need to do sets intersections/subtracts in this scenario.
Instead of having the message store send a message to the queue with the confirms for messages ignored due to the flying optimisation, we have the queue handle the confirms directly when removing the messages. This avoids sending potentially 1 Erlang message per 1 AMQP message to the queue.
Also make use of the opened file for multi-reads instead of opening/reading/closing each time.
The way I initially did this the maybe_gc would be triggered based on candidates from 15s ago, but run against candidates from just now. This is sub-optimal because when messages are consumed rapidly, just-now candidates are likely to be in a file about to be deleted, and we don't want to run compaction on those. Instead, when sending the maybe_gc we also send the candidates we had at the time. Then 15s later we check if the file still exists. If it's gone, great! No compaction to do.
This is ready for review/merge. |
Full test results: The biggest difference is in confirm latency, when using And when publishing to a long queue (no consumers): (the sudden drop in throughput is when the queues reach their |
So, a 40% drop in publisher confirm latency on one workload, and a 60% drop on another (both have publishers and consumers online). Not bad. |
Another round of CQ shared message store optimisations and refactors, this time around writes.
The first commit is more a refactor than anything, although no longer calling fsync does help in some scenarios. The second commit should provide a noticeable boost in performance when there are no consumers.
@mkuratczyk I have renamed the branch.