On Fri, 2009-03-13 at 01:25 +0100, Peter Meier wrote:
> Hi
> 
> > Are you talking about the fix for the bug #1469?
> > If yes, it will be in 0.25 only (it would be very difficult to backport 
> > it as it was possible to implement it for 0.25 because Luke did a huge 
> > refactor of the file type).
> > 
> > Note, that this bug improves the situation only if your file{} resource 
> > has the source attribute (downloading files from the puppetmaster).
> > 
> > In your case, I think using checksum => undef should be enough to 
> > tremendously speed-up this operation.
> 
> I'm currently a bit in the same or at least similar situation as we try
> to ensure that certain folders and their content of webapplications
> always have the right permission. so our idea have been to use the file
> resource on these folders, with recursive set to true, etc.
> 
> Speed doesn't matter that much, what matters more is the memory usage.
> 
> So this is our test-scenario:
> 
> --- foo.pp ---
> 
> $documentroot='/var/www/vhosts/path/to/joomla/installation/www'
> 
> file{ [ "$documentroot/administrator/backups",
>       "$documentroot/administrator/components",
>       "$documentroot/administrator/language",
>       "$documentroot/administrator/modules",
>       "$documentroot/administrator/templates",
>         "$documentroot/components",
>         "$documentroot/images",
>         "$documentroot/language",
>         "$documentroot/media",
>         "$documentroot/modules",
>         "$documentroot/plugins",
>         "$documentroot/templates",
>         "$documentroot/cache",
>         "$documentroot/administrator/cache" ]:
>               owner => 'user',
>                 group => 'group',
>                 mode => 0660,
>                 recurse => true,
>                 backup => false,
>                 checksum => undef,
> }
> ---
> 
> a run of just that manifest (so puppet foo.pp) can take up to:
> 
> VIRT  RES
> 273m 193m
> 
> of Memory Usage.

Yes, that's a lot. Unfortunately for such manifests puppet has to create
a child file object per file it found while recursing the hierarchy.

If your aim is just to change/maintain ownership/perms, maybe an exec of
a recusive chown or combination of find/chown would be better, something
akin to:

exec {
  "chown-joomla-files":
        command => "find -type f ! -user 'user' | xargs chown user"
}
...

You see the idea...
Yes, the exec will execute on each catalog run, but that shouldn't be an
issue.

> if I don't set recurse (and this is the way we go currently)
> everything's fine. So it certainly has to do with recursing a file tree.
> I'm running nearly latest head, at least #1965 [1] is applied.

#1965 won't help on the client side. I didn't reread the patch, but if I
remember correctly it helps for storing the path used in the AST tree.

I think I'll have a closer look to this issue soon.
-- 
Brice Figureau
My Blog: http://www.masterzen.fr/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to