-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Bindings optimisation #1715
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
Bindings optimisation #1715
Conversation
…in bindings where possible. Route table key contains all the route information, which makes delete equivalent to delete_object. But it's faster. For the same reason match_object with a full object is equivalent to read.
match_object locks entire table, we'd like to avoid that. It's possible to not call delete_for_source if exchange is autodeleted. Checking an autodelete exchange will lock table on scanning for outgoing bindings anyway. But other cases will not lock the table.
Exclusive queue cleanup benchmark: Time to cleanup queues on connection:
Since default bindings are a separate PR now, this numbers should be shifted right for the "after" row. Still there is an optimisation. |
Time to delete queues/exchanges:
|
This can be backported to 3.7 if accepted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I observe test failures not present in master, e.g. try
gmake distclean; gmake ct-queue_master_location; open logs/index.html
The interesting thing about default bindings and min-master locator is that it's counting queue masters looking at bindings, but all queues were bound. Originally it was counting bindings and selecting a node which min bindings to the queues on the node. Then it was changed in 1d413ea to count multiple bindings for the same queue as one. The assumption was that we should not account for unbound queues. But any queue had at least 1 binding (default). |
The test now passes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above failures are gone but there are still failures in rabbitmq-management
's test suite that are not present in master, e.g. try:
gmake ct-rabbit_mgmt_http
Not all tests have something to do with bindings.
So default bindings are shown in the management API. I've missed that somehow. I still don't think we should store them in the database. Maybe we could fake them for the management API |
8539822
to
a9dc1f8
Compare
Moved default bindings removal to a separate PR since most of the failures are about that change. It might be even for 3.8. |
@hairyhum we can append them in HTTP API handlers and |
…or functions that list bindings, that'd cover more cases with a single change? |
@michaelklishin maybe. That's why it's a separate PR. |
Merged to 3.7 |
#1721, a spin-off from this issue, was merged for 3.8. |
A follow-up to #1589.
Fixes #1690.
A number of optimisations around bindings. Apparently there is not much sense in adding table indexes to binding tables, as index read locks entire table. Indexes could slightly improve performance when there are many bindings and queues, but will require a breaking change in the schema.
The changes in this branch provide performance improvement comparable to introduction of indexes without reworking the schema:
delete_object
withdelete
as bindings are value-objects and there are no bag tablesmatch_object
is replaced withdirty_match_object
to not lock the entire bindings table. This change was reverted in d0423f9 because it was creating inconsistencies withdirty_delete
. Current branch does not contain dirty deletes. Still requires more testing.list_bindings
. They are not used, but slow down queue deletion and creation.Benchmark data will follow.