Issue #23335 has been reported by Glenn Poston.

----------------------------------------
Bug #23335: external facts cause puppet apply to take inordinately longer to run
https://projects.puppetlabs.com/issues/23335

* Author: Glenn Poston
* Status: Unreviewed
* Priority: High
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
My external fact script takes 5s to run.

With external fact...
puppet takes 2.5m to run
facter takes 33s to run

Without external fact...
puppet takes 27s to run
facter takes 0.68s

Bottom line... there's no significant change in facter runtime when parsing the 
external fact, but the puppet runtime quadruples.

>From watching the logs in real time I can see that the extra time is taken 
>before puppet outputs its first response line (compilation time).  Also note 
>that the compilation time that puppet reports is ~2s even though (when 
>watching the output realtime) it takes 2 minutes for that line to return when 
>puppet is parsing the external fact script.

Note: This script generates 36 custom facts

Should I submit a bug for this?

#Time of external fact script
[root@fisheye-10-0-2-15 manifests]# time 
/etc/facter/facts.d/service_discovery.sh
environment=test
...
service_discovery_script=ran

real    0m5.478s
user    0m0.053s
sys     0m0.111s

# Time of puppet run with external fact
[root@fisheye-10-0-2-15 manifests]# time FACTER_environment='vagrant' 
FACTER_role='fisheye' puppet apply --modulepath 
'/etc/puppet/modules:/tmp/vagrant-puppet/modules-0' site.ppNotice: Compiled 
catalog for fisheye-10-0-2-15.inin.com in environment production in 2.22 seconds
Notice: Finished catalog run in 30.76 seconds

real    2m25.856s
user    0m5.124s
sys     0m3.830s

#Time of facter with external fact
[root@fisheye-10-0-2-15 manifests]# time facter
analyticsapisegmentindexconsusmerwaittimeseconds => 1
architecture => x86_64
...
uptime_hours => 0
uptime_seconds => 2529

real    0m33.587s
user    0m0.658s
sys     0m0.849s

#Removing external fact script
[root@fisheye-10-0-2-15 manifests]# rm /etc/facter/facts.d/service_discovery.sh
rm: remove regular file `/etc/facter/facts.d/service_discovery.sh'? y
[root@fisheye-10-0-2-15 manifests]# ls /etc/facter/facts.d/

#Time of puppet run without external fact script
[root@fisheye-10-0-2-15 manifests]# time FACTER_environment='vagrant' 
FACTER_role='fisheye' puppet apply --modulepath 
'/etc/puppet/modules:/tmp/vagrant-puppet/modules-0' site.pp
Notice: Compiled catalog for fisheye-10-0-2-15.inin.com in environment 
production in 2.06 seconds
Notice: 
/Stage[main]/System::Facts/Facter::Fact[service_discovery]/File[/etc/facter/facts.d/service_discovery.sh]/ensure:
 created
Notice: Finished catalog run in 23.22 seconds

real    0m27.550s
user    0m4.408s
sys     0m2.292s

# Removing script again (cuz puppet run put it back)
[root@fisheye-10-0-2-15 manifests]# rm /etc/facter/facts.d/service_discovery.sh
rm: remove regular file `/etc/facter/facts.d/service_discovery.sh'? y
[root@fisheye-10-0-2-15 manifests]# ls /etc/facter/facts.d/

#Time of facter run without external script
[root@fisheye-10-0-2-15 manifests]# time facter
architecture => x86_64
augeasversion => 0.9.0
...
virtual => virtualbox

real    0m0.687s
user    0m0.324s
sys     0m0.287s


-- 
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