Jira (FACT-449) Facter is very slow in presence of large number of network interfaces

16 views
Skip to first unread message

Tim Spriggs (JIRA)

unread,
Mar 10, 2015, 5:04:24 PM3/10/15
to puppe...@googlegroups.com
Tim Spriggs commented on Bug FACT-449
 
Re: Facter is very slow in presence of large number of network interfaces

I've been hit by this. ifconfig takes 0.159 seconds to run and facter as a whole takes ~30s on my test node.

Adapting this idiom will make the above patch much cleaner:

  1. From http://stackoverflow.com/questions/3602518/how-do-i-cache-a-method-with-ruby-rails
    def get_listings
    @listings ||= get_listings!
    end

def get_listings!
Hpricot.XML(open(xml_feed))
end

https://github.com/puppetlabs/facter/blob/master/lib/facter/util/ip.rb#L81

For reference, the 'ip addr' command takes 0.009s to run on this same node.

Using 'ip addr' or caching the output of 'ifconfig -a' will make facter run in a small fraction of the time with negligible overhead.

I'm currently using facter 2.4.1 from a gem.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a)
Atlassian logo

Michael Smith (JIRA)

unread,
Feb 17, 2016, 1:35:09 PM2/17/16
to puppe...@googlegroups.com
Michael Smith commented on Bug FACT-449

This may be greatly improved in Facter 3.

This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc)
Atlassian logo

Michael Smith (JIRA)

unread,
Feb 17, 2016, 6:32:04 PM2/17/16
to puppe...@googlegroups.com

Martin Magr (JIRA)

unread,
May 20, 2019, 7:49:03 AM5/20/19
to puppe...@googlegroups.com
Martin Magr commented on Bug FACT-449
 
Re: Facter is very slow in presence of large number of network interfaces

Would it be possible to identify in this ticket all patches that are required for backport this fix to 2.x branch? Is this even doable?

This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages