Jira (FACT-1904) facter (leatherman) is slow if nofile ulimit is bigger than default

2 views
Skip to first unread message

Andrey Kolashtov (JIRA)

unread,
Jan 16, 2019, 12:16:03 PM1/16/19
to puppe...@googlegroups.com
Andrey Kolashtov created an issue
 
Facter / Bug FACT-1904
facter (leatherman) is slow if nofile ulimit is bigger than default
Issue Type: Bug Bug
Affects Versions: FACT 3.12.3
Assignee: Unassigned
Created: 2019/01/16 9:15 AM
Priority: Normal Normal
Reporter: Andrey Kolashtov

Facter is slow if nofile ulimit is set to big values like 5000000. E.g.:

  1. ulimit -n 65536
  2. time facter networking > /dev/null
    real 0m0.396s
    user 0m0.200s
    sys 0m0.196s
  3. ulimit -n 6553600
  4. time facter networking > /dev/null
    real 0m28.003s
    user 0m12.812s
    sys 0m15.190s

The problem is in https://github.com/puppetlabs/leatherman/blob/master/execution/src/posix/execution.cc#L318, leatherman closes all descriptors from stderr to max open file limit before execve (for running ip link or other command) and it takes about 3-4 seconds for 10M descriptors every time when it executes any binary. 

We use OS Ubuntu 18.04, puppet 6.1.0, facter 3.12.2.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Andrey Kolashtov (JIRA)

unread,
Jan 16, 2019, 12:17:03 PM1/16/19
to puppe...@googlegroups.com
Andrey Kolashtov updated an issue
Change By: Andrey Kolashtov
Facter is slow if nofile ulimit is set to big values like 5000000. E.g.:

# $ ulimit -n 65536
# $ time facter networking > /dev/null

real 0m0.396s
user 0m0.200s
sys 0m0.196s
#
$
ulimit -n 6553600
# $ time facter networking > /dev/null

real 0m28.003s
user 0m12.812s
sys 0m15.190s


The problem is in [https://github.com/puppetlabs/leatherman/blob/master/execution/src/posix/execution.cc#L318,] leatherman closes all descriptors from stderr to max open file limit before execve (for running _ip link_ or other command) and it takes about 3-4 seconds for 10M descriptors every time when it executes any binary. 


We use OS Ubuntu 18.04, puppet 6.1.0, facter 3.12.2.

Andrey Kolashtov (JIRA)

unread,
Jan 16, 2019, 12:17:03 PM1/16/19
to puppe...@googlegroups.com
Andrey Kolashtov updated an issue
Facter is slow if nofile ulimit is set to big values like 5000000 6553600 . E.g.:

$ ulimit -n 65536

$ time facter networking > /dev/null
real 0m0.396s
user 0m0.200s
sys 0m0.196s

$ ulimit -n 6553600

$ time facter networking > /dev/null
real 0m28.003s
user 0m12.812s
sys 0m15.190s

The problem is in [https://github.com/puppetlabs/leatherman/blob/master/execution/src/posix/execution.cc#L318,] leatherman closes all descriptors from stderr to max open file limit before execve (for running _ip link_ or other command) and it takes about 3-4 seconds for 10M descriptors every time when it executes any binary. 

We use OS Ubuntu 18.04, puppet 6.1.0, facter 3.12.2.

Geoff Nichols (JIRA)

unread,
Jan 22, 2019, 2:11:03 PM1/22/19
to puppe...@googlegroups.com

Ciprian Badescu (JIRA)

unread,
Aug 22, 2019, 10:54:03 AM8/22/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages