Issue #21249 has been updated by Charlie Sharpsteen.

Status changed from Unreviewed to Accepted
Target version deleted (3.x)

Puppet performs quite a few stat calls on each directory entry to determine 
which files to tidy. With 100,000 entries in a single directory, the filesystem 
performance is likely degraded to the point where each stat is consuming a 
significant amount of time.

Additionally, tidy doesn't do bulk deletions. [It creates a new File resource 
for each individual 
entry](http://docs.puppetlabs.com/references/latest/type.html#tidy) and 
evaluates that resource to perform the removals on a file by file basis. This 
incurs additional stat calls.

So, the bottom line is that tidy wasn't designed to perform deletions at the 
scale you are considering. Handling this situation in a performant manner will 
require a re-design of the tidy implementation.

----------------------------------------
Bug #21249: Delete file using tidy resource causes system (Agent) runs in high 
load and (seem) never stop
https://projects.puppetlabs.com/issues/21249#change-92973

* Author: Mike Phung
* Status: Accepted
* Priority: High
* Assignee: 
* Category: agent
* Target version: 
* Affected Puppet version: 3.2.1
* Keywords: tidy, memory, high load
* Branch: 
----------------------------------------
We want to use pupet to delete a bunch of files using tidy resource, the test 
config looks like followings

tidy { '/home/mike/temp':
age => '0',
recurse => true,
rmdirs => false,
}

there are 100.000 files in the /home/mike/temp, i know that it's a little bit 
exaggerative, but you never know in the future if you want to keep clean a 
directory which has a lot of temp files.

i ran puppet using the command

puppet agent --no-daemonize --onetime --debug

Output of top -c, puppet stays always in the first line

 PID     USER       PR   NI  VIRT     RES     SHR S  %CPU  %MEM    TIME+     
COMMAND
14769 root       20    0   1588m 769m  252 D  2.0   77.6    36:40.70  
/usr/bin/ruby /usr/bin/puppet

Until now, after 19 hours of runs puppet is still holding more than 70% memory.

[root@dev-stage-minion6 lib]# ps -p 14769 -o etime=

19:04:17

Testing environment 
====================  

puppet --version 
3.2.1
ruby --version 
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
OS Version:
CentOS release 6.3 (Final)

====================  

Please find below the attached message log, as the last_run_report.yaml and 
last_run_summary.yaml aren't available as the puppet doesn't finish yet. You 
will find that our rsyslog start to drop message from the pid 14769 due to 
rate-limitting, for the next time, i already disable this features, so feel 
free to ask the new log file if you need.

regards,

Mike 






-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to