Skip to content

Add a configurable limit for number of exchanges (backport #14304) #14339

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

Merged
merged 2 commits into from
Aug 7, 2025

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Aug 7, 2025

This is like @SimonUnge's past work for vhosts and queues but for limiting the total number of exchanges.

Vhosts and queues are more expensive since they run processes while exchanges are just metadata. A limit would be good for exchanges too though, because if you create a really large number of them you can increase the memory footprint by quite a bit - through taking more space in the metadata store and making more work for monitoring. By default the limit is unset and it can be enabled with cluster_exchange_limit = 100 or explicitly disabled with cluster_exchange_limit = infinity, like the vhost limit.

I've also added some small changes to the Khepri impls for rabbit_db_exchange's count/0 and exists/1 so that we use the projection ETS table rather than a query, to make this as cheap as possible.


This is an automatic backport of pull request #14304 done by Mergify.

These functions will be used in the child commit for a check on
the number of exchanges. We can use the projection to avoid bothering
the Khepri process with a query.

(cherry picked from commit 392e5f9)
@michaelklishin michaelklishin added this to the 4.1.4 milestone Aug 7, 2025
@michaelklishin michaelklishin merged commit dcbd1e2 into v4.1.x Aug 7, 2025
274 of 275 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.1.x/pr-14304 branch August 7, 2025 02:08
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.

2 participants