Bug 1440769 - autofs is facing scalability issues
Summary: autofs is facing scalability issues
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: autofs
Version: 7.3
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: rc
: ---
Assignee: Ian Kent
QA Contact: xiaoli feng
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-10 12:48 UTC by Marco Benatto
Modified: 2017-08-01 12:43 UTC (History)
5 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2017-08-01 12:43:52 UTC


Attachments (Terms of Use)
RHEL7.3's autofs backported patch (12.82 KB, patch)
2017-04-10 12:48 UTC, Marco Benatto
no flags Details | Diff
Patch - improve scalability of direct mount path component (4.95 KB, patch)
2017-04-17 00:53 UTC, Ian Kent
no flags Details | Diff
Program to create a large autofs direct mount map (1.22 KB, text/plain)
2017-04-18 01:07 UTC, Ian Kent
no flags Details
autofs daemon coredump (9.63 MB, application/x-gzip)
2017-05-09 13:38 UTC, Marco Benatto
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2213 normal SHIPPED_LIVE autofs bug fix and enhancement update 2017-08-01 16:09:35 UTC

Description Marco Benatto 2017-04-10 12:48:21 UTC
Created attachment 1270487 [details]
RHEL7.3's autofs backported patch

Description of problem (from SFDC case):
"autofs service takes extremely long time since its creating the directory hierarchy for all direct mounts maps. We have quite a good number of direct maps ( approx 20k ) coming from LDAP and autofs fails when we restart autofs or system rebooted.  In /usr/lib/systemd/system/autofs.service changing  TimeoutSec to a higher values to  seems to work but hours to start automounter may not be a acceptable for production systems."
 
Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 7
autofs-5.0.7-56.el7.x86_64
 
Additional info:
 
Customer is complaining about scalability issues when using autofs with large direct mappings. His environment has around 20k direct maps from LDAP and is taking a long time to complete the startup process impacting on their production.
 
Looking at upstream commits for autofs was possible to find:
 
 commit 67e7d613a4b09eeffc57ab44a7acb52027d897b2
 Author: Jeff Mahoney <jeffm@suse.com>
 Date:   Thu Mar 24 09:13:50 2016 +0800
 
     autofs-5.1.1 - improve scalability of direct mount path component
 
     With direct mounts, we want to avoid creating path components on
     remote file systems unless that file system is the root file system.
 
     The check boils down to allowing the mkdir if:
     1/ If it's the root directory, or
     2/ If it's not a remote file system, or
     3/ If it's a remote file system that's the root file system
 
     We can do that without parsing the mount table and can
     improve startup time for all cases.
 
     Signed-off-by: Jeff Mahoney <jeffm@suse.com>
     Signed-off-by: Ian Kent <raven@themaw.net>
 
which may fit this case. Checking on dist-git is possible to notice this patch wasn't being applied.
 
On last week I've backported it to rhel7.3 autofs version and built a test package which client had tested for the last four days. According to their testing the patch solved their issue.
 
I'm attaching backported patch for your review.

Thanks,
-Marco Benatto
Sr. Software Maintenance Engineer
Red Hat

Comment 8 Ian Kent 2017-04-17 00:53 UTC
Created attachment 1271935 [details]
Patch - improve scalability of direct mount path component

Comment 12 Ian Kent 2017-04-18 01:07 UTC
Created attachment 1272203 [details]
Program to create a large autofs direct mount map

I used this simple program to create an autofs direct mount
map with 30000 entries.

The mount location obviously relates to my own environment
and would need to be changed to be used within a beaker
test environment. Also the direct mount entry using the
map needs to be added to the master map.

Using this it is easy to reproduce the problem.

On limited capacity VM using autofs revision 56 automount
was only able to mount just over 4000 direct mounts before
systemd (with default settings) killed it for taking too
long.

With autofs revision 64 I was able to successfully start
autofs.

Comment 25 Marco Benatto 2017-05-09 13:38 UTC
Created attachment 1277371 [details]
autofs daemon coredump

Comment 58 errata-xmlrpc 2017-08-01 12:43:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2213


Note You need to log in before you can comment on or make changes to this bug.