How to increase performance of managed directories?

129 views
Skip to first unread message

Schofield

unread,
Jan 9, 2013, 8:01:19 PM1/9/13
to puppet...@googlegroups.com
I have several directories that are installed and managed with puppet.  I am finding the majority of the time of the puppet run is spent validating the directory.  Are there any tricks to improve the performance of managed directories? Or a better way than simple file resource with  ensure => directory and recurse => true?

  file {'/xyz/directory' :
    ensure => directory,
    recurse => true,
    source => "puppet:///modules/mymod/directory",
  }

Denmat

unread,
Jan 10, 2013, 1:39:54 AM1/10/13
to puppet...@googlegroups.com
Smaller directories? :)

But seriously Puppet sucks at distributing large directories (you should see posts to the list going back years on this topic). If you look at the file type resource docs (http://docs.puppetlabs.com/references/stable/type.html#file)you can see you can change the checksum used, ignore files (unsure of speed improvements there), recurselimit to limit the depth of recursion and possibly the mtime attribute.

Alternatively, if running *nix you could try rsync in an exec. 

Your mileage may vary,

Den
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/TuE-ygecAngJ.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Peter Brown

unread,
Jan 10, 2013, 1:57:34 AM1/10/13
to puppet-users
I used to manage a few directories recursively and it was very slow and cumbersome.
I just manage the directories themselves if i need to and the files individually.
It makes it a bit more complex initially but you get fine grained control over things and it's so much faster.

If you really need to manage a directory recursively and there is no other way I recommend using your preferred version control system.
If you want to do that easily with puppet then puppetlabs/vcsrepo on the forge looks like the nicest way of doing it.

Schofield

unread,
Jan 28, 2013, 9:49:55 AM1/28/13
to puppet...@googlegroups.com
On Thursday, January 10, 2013 1:57:34 AM UTC-5, Pete wrote:
I used to manage a few directories recursively and it was very slow and cumbersome.
I just manage the directories themselves if i need to and the files individually.
It makes it a bit more complex initially but you get fine grained control over things and it's so much faster.

If you really need to manage a directory recursively and there is no other way I recommend using your preferred version control system.
If you want to do that easily with puppet then puppetlabs/vcsrepo on the forge looks like the nicest way of doing it.

Is there a simple way to recursively pull directories down from the puppet master if they don't exist, but if the root directory does exist don't bother recursively checking them?
Reply all
Reply to author
Forward
0 new messages