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
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:
Author: Jeff Mahoney <firstname.lastname@example.org>
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 <email@example.com>
Signed-off-by: Ian Kent <firstname.lastname@example.org>
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.
Sr. Software Maintenance Engineer
Created attachment 1271935 [details]
Patch - improve scalability of direct mount path component
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
With autofs revision 64 I was able to successfully start
Created attachment 1277371 [details]
autofs daemon coredump
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.