Ask Your Question
1

why are external facts causing puppet apply to take inordinately longer to run

asked 2013-12-02 21:01:30 -0500

gposton gravatar image

updated 2014-01-22 13:42:11 -0500

Stefan gravatar image

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 ... (more)

edit retag flag offensive close merge delete

Comments

I did some more reseach. I created an external fact that echos the same content that my previous script would evaluate to. Then added a sleep to the script.

gposton gravatar imagegposton ( 2013-12-03 12:06:49 -0500 )edit

When the script resolves instantaneously (echo statment only) script takes .004s facter takes .754s puppet takes 1m

gposton gravatar imagegposton ( 2013-12-03 12:07:01 -0500 )edit

When the script takes 1s (sleep 1, then echo) script takes 1s facter takes 6s puppet takes 1m12s

gposton gravatar imagegposton ( 2013-12-03 12:07:13 -0500 )edit

When the script takes 5s (sleep 5, then echo) script takes 5s facter takes 30s puppet takes 2m38s

gposton gravatar imagegposton ( 2013-12-03 12:07:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-01-15 23:47:30 -0500

rjc gravatar image

This is due to the fact - unintentional pun ;^) - that custom facts are being run multiple times byfacter (as you can see from this bug report), which in turn is being run more than once by puppet.

P.S. facter actually comes with --timing option, which give you a breakout of time each fact takes to run, so there's no need to use time.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-12-02 21:01:30 -0500

Seen: 165 times

Last updated: Jan 22 '14