On Wed, 20 Feb 2013 14:17:16 +0100, Brice Figureau <[email protected]> wrote: >> > * serializing it back to the client_state cache (unfortunately we >> > apparently can't get rid of this part) >> >> What is this cache used for? I do not understand the necessity for it. >> Can >> I disable this somehow? > > I don't know if you can disable it. It's purpose I believe is to still > be able to perform an agent run if the master can't be contacted, and > was at a time used for catalog caching (ie as a measure to reduce load > on the master).
And it does not seem to be the problem. This, which I believe to be the state file loader, @compile_time ||= Puppet::Util::Storage.cache(:configuration)[:compile_time] takes 0.00 seconds. >> > * at the same time managing the state file >> > >> > Now to really know what exactly takes time, you'll have to add debug >> > statements in the agent code base. >> >> I'll see what I can do. > > That's as easy as decorating the code you want to time with: > benchmark(:notice, "Code that does this") do > ... code to bench ... > end > > (you first need to "include Puppet::Util" in the current class) > > Then when the benchmarked code will be run, it will log the time in the > log. > > So, all the gory details of catalog caching and retrieval happens in the > lib/puppet/configurer.rb file. So I added benchmarking statements to most methods in this file. Sometimes that needed fixing the scope of some vars, it sucks that benchmark seems to swallow the result. Or I do not (want to) understand ruby enough. Results: * convert_catalog takes 33s or 5% of run() time * retrieve_new_catalog takes 444s or 70% of run() time. This is basically a call to Puppet::Resource::Catalog.indirection.find * the puppetmaster claims to take 164s to compile the catalog, but I still see the rack process running at full throttle, while the agent is waiting. This brought me onto a new trail to follow. Fumbling my way through the puppet source, I finally stumbled over this: Feb 20 17:06:05 puppet puppet-master[22370]: Compiled catalog for somehost.example.net in environment prod in 7.57 seconds Feb 20 17:06:14 puppet puppet-master[22370]: Handled request in 16.78 seconds *ca-ching* I tried to follow *that* rabbit hole further, but time's running out for today and I do not see how the Puppet::Network::HTTP::RackREST.new.process dispatches requests. Best Regards, David -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-dev?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
