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

Question: URL method downloads the zip file every run? #270

Closed
brahama opened this issue Jul 4, 2016 · 10 comments
Closed

Question: URL method downloads the zip file every run? #270

brahama opened this issue Jul 4, 2016 · 10 comments

Comments

@brahama
Copy link

brahama commented Jul 4, 2016

Hi guys!

Every run of consul module makes the total run of puppet increase by 60 seconds. I assume that it it becasue it downloads the zip every time. Could this be? Thanks!

@solarkennedy
Copy link
Contributor

It should not be downloading every time. Add --debug to the run output and pipe to ts and maybe that might help reveal the slowdown?

@brahama
Copy link
Author

brahama commented Jul 4, 2016

Great Tip! i was thinking in preappending timestamp to debug.. thankks!

Here are some of the outpuut

Jul 04 15:46:30 Debug: /Stage[main]/Consul::Install/File[/usr/local/bin/consul]: Adding autorequire relationship with File[/opt/puppet-archive/consul-0.6.4/consul]
Jul 04 15:46:45 Debug: /Stage[main]/Consul::Config/File[/etc/init.d/consul]: Adding autorequire relationship with User[root]
Jul 04 15:46:45 Debug: /Stage[main]/Consul::Config/File[/etc/init.d/consul]: Adding autorequire relationship with Group[root]
Jul 04 15:46:45 Debug: /Stage[main]/Consul::Config/File[/etc/consul]: Adding autorequire relationship with User[consul]
Jul 04 15:46:45 Debug: /Stage[main]/Consul::Config/File[consul config.json]: Adding autorequire relationship with User[consul]
Jul 04 15:46:45 Debug: /Stage[main]/Accounts::Users/Accounts::User[root]/User[root]: Adding autorequire relationship with Group[root]

Takes 15 seconds there.

Then here i added a notify previouus to the include of consul

Jul 04 15:46:46 Debug: /Stage[main]/Pbis/Exec[join_domain]/unless: NetBIOS Domain Name:
Jul 04 15:46:46 Debug: Executing: '/usr/bin/yum check-update'
Jul 04 15:46:47 Debug: Prefetching aliases resources for mailalias
Jul 04 15:46:47 Notice: Lets install consul agent
Jul 04 15:46:47 Notice: /Stage[main]/Role::Defaults/Notify[Lets install consul agent]/message: defined 'message' as 'Lets install consul agent'
Jul 04 15:46:47 Debug: /Stage[main]/Role::Defaults/Notify[Lets install consul agent]: The container Class[Role::Defaults] will propagate my refresh event
Jul 04 15:47:28 Notice: Linux default without consul agent false
Jul 04 15:47:28 Notice: /Stage[main]/Role::Defaults/Notify[Linux default without consul agent false]/message: defined 'message' as 'Linux default without consul agent false'
Jul 04 15:47:28 Debug: /Stage[main]/Role::Defaults/Notify[Linux default without consul agent false]: The container Class[Role::Defaults] will propagate my refresh event

I will continue debugging as i dont clearly see whatactions are taking this extra time

Thanks!

@brahama
Copy link
Author

brahama commented Jul 4, 2016

Here i just commented the include that calls consul and it took much less time

Jul 04 16:25:15 Debug: Executing: '/usr/bin/yum check-update'
Jul 04 16:25:19 Debug: Prefetching aliases resources for mailalias
fresh event
Jul 04 16:25:19 Notice: Linux default without consul agent false
Jul 04 16:25:19 Notice: /Stage[main]/Role::Defaults/Notify[Linux default without consul agent false]/message: defined 'message' as 'Linux default without consul agent false'
Jul 04 16:25:19 Debug: /Stage[main]/Role::Defaults/Notify[Linux default without consul agent false]: The container Class[Role::Defaults] will propagate my refresh event
Jul 04 16:25:19 Debug: Class[Role::Defaults]: The container Stage[main] will propagate my refresh event

Still looking..

@brahama
Copy link
Author

brahama commented Jul 4, 2016

I removed the notify... how can i look deeper here?

Jul 04 18:12:46 Debug: Cleanup archive /opt/puppet-archive/consul-0.6.4.zip
Jul 04 18:13:31 Debug: /File[/etc/consul/config.json]/seluser: Found seluser default 'system_u' for /etc/consul/config.json

It always stays there the longest. In the server logs, no long request. all normal times.

heres the culprit but its strange

Info: /Stage[main]/Consul::Install/User[consul]: Starting to evaluate the resource
Info: /Stage[main]/Consul::Install/User[consul]: Evaluated in 54.66 seconds

Will see if this is related to the thing that i am using pam with ldap..

@brahama
Copy link
Author

brahama commented Jul 4, 2016

Yeps. Thats the bug. I would say in User resource. It does the check for the entire ldap so it takes almost 60 seconds to eval.
No forcelocal being honored so dunno how to override this yet..

@brahama
Copy link
Author

brahama commented Jul 4, 2016

Really dunno how to avoid this. If you have any idea i really appreciate.

Cheers!

@solarkennedy
Copy link
Contributor

If you know you want puppet to be using an attribute in a particular way, you can set a global resource default:

User {
  forcelocal => true
}

https://docs.puppet.com/puppet/latest/reference/lang_defaults.html

Or you could tell the module to not manage the user:
https://github.com/solarkennedy/puppet-consul/blob/master/manifests/init.pp#L56

And make the user manually in ldap?

@brahama
Copy link
Author

brahama commented Jul 5, 2016

Thanks for the answer! I already did thhe default in the main site.pp but as i mentioned, there is a bug in puppet that doesnt honour it. So, the user is created and its working all ok. But the catalog now takes 70seconds instead of 5s. Whats weird is that, i manage local users in other modules and doesnt seem to be affected. I was thinking in managing it ouutside consul as you suggest. Will see if in my users moduule a create the consul user and see what happens.

Thanks! You can close this if you want or wait till i test this and post it here so it appears the solution.
As you wish. Thanks for the help!

@brahama
Copy link
Author

brahama commented Jul 5, 2016

Well, as a workaorund i set a resource user {'consul': ensure => present} in one of my profiles and set manage_user to false in consul module. This makes the catalog to apply in 5 seconds, instead of 70.
What i am not sure is, why if i use the resource outside consuul module, it works ok, and the consul module, the same resource takes a minute longer. Too weird! So this is ok to closee. Thanks for the help and anyone should see this perf issue, you can know where to look.

@solarkennedy
Copy link
Contributor

That sounds like an OK solution. The only possible issue I could think of is parse-ordering issue where the resource defaults are not taking precedence before consul is evaluated.

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

No branches or pull requests

2 participants