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

User management execution optimisation #463

Closed
vladzu opened this issue Oct 3, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@vladzu
Copy link

commented Oct 3, 2017

Hi,
This is more an optimisation request not the bug.
under providers/user.rb there are functions like :
def user_exists?(name)
def user_has_tag?(name, tag)

It executes rabbitmqctl -q list_users on every user 2x times.
If there are more than 10 users - this operation start to be time consuming.
The similar thing is with def user_has_permissions?(name, vhost, perm_list = nil)

Our proposal is to write rabbitmqctl -q list_users and rabbitmqctl -q list_user_permissions into buffer or temporary file and then use it for check. It should make all those checks much faster/

@michaelklishin

This comment has been minimized.

Copy link
Member

commented Oct 3, 2017

@jjasghar is it common for resources to cache external tool output in modern Chef?

It's fairly unlikely to see 10s of thousands of users, so rabbitmqctl list_users output should be suitable for keeping in memory.

@vladzu

This comment has been minimized.

Copy link
Author

commented Oct 9, 2017

Hi,
So what is the decision ?

@michaelklishin

This comment has been minimized.

Copy link
Member

commented Oct 9, 2017

I haven't heard from @jjasghar. Caching is something that always seems straightforward and almost always has unexpected side effects. If you need to create a lot of users and permissions, consider using definitions import — improving support for which in this cookbook is definitely welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.