Jira (FACT-3157) Facter 3 command very slow with -p option for single-facts

8 views
Skip to first unread message

otheus (Jira)

unread,
Oct 7, 2022, 9:44:03 AM10/7/22
to puppe...@googlegroups.com
otheus updated an issue
 
Facter / Bug FACT-3157
Facter 3 command very slow with -p option for single-facts
Change By: otheus
Summary: Comply: Defect Facter 3 command very slow with -p option for single-facts
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

otheus (Jira)

unread,
Oct 7, 2022, 9:45:02 AM10/7/22
to puppe...@googlegroups.com
otheus commented on Bug FACT-3157
 
Re: Facter 3 command very slow with -p option for single-facts

Although I have identified the fact that takes an extraordinary amount of time, the point is, the command should not be evaluating all facts when it is requested a single fact.

otheus (Jira)

unread,
Oct 7, 2022, 9:49:02 AM10/7/22
to puppe...@googlegroups.com
otheus updated an issue
Change By: otheus
Facter 3.14 is 80x slower compared to facter 2.x. when requesting a single fact. Analysis indicates that all facts are processed and evaluated, not only the ones requested.


The facter command should evaluate only those facts requested (and dependencies) on the command line.

---

From facter 2.4.6
{code}

time facter -p operatingsystem
RedHat

real    0m0.754s
user    0m0.525s
sys     0m0.075s
{code}

From 3.14.24:
{code}

# time facter -p operatingsystem
RedHat

real    0m8.166s
user    0m6.533s
sys     0m1.084s
{code}

v3.14, without `-p`...
{code}

RedHat

real    0m0.207s
user    0m0.182s
sys     0m0.025s
{code}

v3.14, with -p but non-root:
{code}

2022-10-07 14:22:42.150228 WARN  puppetlabs.facter - skipping external facts for "/home/XXXX/.puppetlabs/opt/puppet/cache/facts.d": No such file or directory
RedHat

real    0m1.115s
user    0m0.969s
sys     0m0.131s
{code}


Using Ruby (as root) to retrieve core fact:
{code}

time /opt/puppetlabs/puppet/bin/ruby -rfacter -e 'p Facter.value("operatingsystem");'
"RedHat"

real    0m0.105s
user    0m0.091s
sys     0m0.014s
{code}

Using facter -p (as root) evaluating a "fast" puppet-sync fact:
{code}

# time facter -p service_provider
systemd

real    0m8.297s
user    0m6.534s
sys     0m1.175s
{code}

Using ruby directly to retrieve puppet-sync'd fact:
{code}

# export FACTERLIB=/opt/puppetlabs/puppet/cache/lib/facter; time /opt/puppetlabs/puppet/bin/ruby -rfacter -e 'p Facter.value("service_provider");'
"systemd"

real    0m1.184s
user    0m1.045s
sys     0m0.137s
{code}

Morgan Rhodes (Jira)

unread,
Oct 11, 2022, 4:20:03 PM10/11/22
to puppe...@googlegroups.com

Morgan Rhodes (Jira)

unread,
Oct 11, 2022, 4:21:02 PM10/11/22
to puppe...@googlegroups.com
Morgan Rhodes commented on Bug FACT-3157
 
Re: Facter 3 command very slow with -p option for single-facts

Hi otheus ! Facter3 is going to be EOL soon, could you check and see if you're seeing the same behavior with facter 4? Thanks!

Reply all
Reply to author
Forward
0 new messages