Hiera Performance Testing

133 views
Skip to first unread message

David Danzilio

unread,
Apr 11, 2014, 4:55:45 PM4/11/14
to puppet...@googlegroups.com
Hi Everybody.

I'm trying to come up with a way to understand how Hiera is going to affect compile times on our Puppet masters. We've got just over 100K lines of Puppet code, and thousands of hosts across a few environments. I know there are a lot of variables to this problem, but I'm drawing a blank on a good way to test this. Has anybody run into this? Is there a simple way to do this that I'm just not seeing?

Thanks!
David

Daniele Sluijters

unread,
Apr 14, 2014, 1:11:36 PM4/14/14
to puppet...@googlegroups.com
Hi,

I think a good start would be to turn on profiling, aka profiling=true in puppet.conf or puppet agent --profile. The output will show up in the master's logs.

-- 
Daniele Sluijters

David Danzilio

unread,
Apr 14, 2014, 1:35:37 PM4/14/14
to puppet...@googlegroups.com
Unfortunately, and I probably should've mentioned this in the OP, we're currently stuck on the 2.7 series.

Daniele Sluijters

unread,
Apr 16, 2014, 3:29:41 AM4/16/14
to puppet...@googlegroups.com
Ah,

Then I'm afraid you're on your own. The instrumentation framework got added and expanded upon somewhere in the 3.x series, I believe 3.2 was the first to be able to give some useful information and as of 3.5 the API is actually public so that others can build on it.

As far as Hiera goes, lookup times depend on a bunch of things. Part of it is the complexity of the hierarchy, the more places it might need to look the longer it will take. If you do a 'normal' hiera call it'll exit on the first match so depending on how quickly it can find a match it'll take a bit longer or not. Then there's the hiera_array and hiera_hash calls which search the whole hierarchy and build up an array or hash of all the returned values which will take longer than a hiera call.

If you really want to get an indication I'd say just switch a few modules to hiera and compare compile times. You could also start adding Hiera.debug() calls with time information in Hiera's backend.rb.

In all honesty though, I'd suggest you get to upgrading to 3.4+ first. That'll give you a bit of a performance boost and 3.4+ doesn't require Hiera, it just ships with it. It'll also enable a bunch of things that will make your life more pleasant as a module author or maintainer. If you're using opensource modules it's likely they'll shortly start dropping 2.7 support if they haven't already with the coming of Puppet 3.6 and 4.x.

-- 
Daniele Sluijters

Nan Liu

unread,
Apr 16, 2014, 12:31:13 PM4/16/14
to puppet...@googlegroups.com
On Mon, Apr 14, 2014 at 12:35 PM, David Danzilio <david.d...@gmail.com> wrote:
Unfortunately, and I probably should've mentioned this in the OP, we're currently stuck on the 2.7 series.

You should be able to run puppet master --compile <certname> and time it to get a coarse measurement of before and after. Just make sure you take a good random sample from a variety of systems with different classes.

HTH,

Nan

David Danzilio

unread,
Apr 21, 2014, 11:43:16 AM4/21/14
to puppet...@googlegroups.com
Thank you for your input Daniele!

We're currently working to move to Puppet 3 but we've got such a large code base, so many people committing to the repo, and so much refactoring to do that it's a very complex and long term project. But I like a challenge! ;-)

David Danzilio

unread,
Apr 21, 2014, 11:44:33 AM4/21/14
to puppet...@googlegroups.com
Thank you Nan!
Reply all
Reply to author
Forward
0 new messages