Skip to contentSkip to conversation

Is Autofs 5 Slower Than 4

DISCUSSION Thanh Tran 4 participants 7 messages Aug 19, 2008 – Apr 26, 2013 Kernel automounter

lore
Share & tools
lore

Thanh Tran

author
#0 lore raw

The Autofs automounting was never blazing fast. However, autofs 5 seems much slower than the previous version. It takes a long time for autofs to mount my detachable drives. It eventually happens; it just takes a long time. Is there a way to improve this speed? Thanks.

#1 lore raw
Quoted 4 lines · Thanh Tran

The Autofs automounting was never blazing fast. However, autofs 5 seems much slower than the previous version. It takes a long time for autofs to mount my detachable drives. It eventually happens; it just takes a long time. Is there a way to improve this speed? Thanks.

Could you quantify this? What exactly are you doing? Are you sure autofs is the cause of the sluggishness? Did you upgrade your entire operating system or just autofs from version 4 to 5? Can you provide a debug log?

Cheers,

Jeff

author
#2 lore raw

I upgraded my entire OS from Fedora 5 to 8. By slow, I mean around 20 seconds to detect and mount. There are too many variables. I was hoping it would be a simple polling flag that could be switched in autofs. I can live with the slower time. I did notice that it took a long time only when I physically removed the drive and re-inserted the drive. When I use the "umount" command and not remove the drive, I can quickly change directory back to drive and it mounts in like 2 seconds at most. Thanks for the help.

Quoted 27 lines · Jeff Moyer

From: Jeff Moyer <[email protected]>
Subject: Re: [autofs] Is Autofs 5 Slower Than 4
To: [email protected]
Cc: [email protected]
Date: Wednesday, August 20, 2008, 10:07 AM

Quoted 1 line · Thanh Tran

The Autofs automounting was never blazing fast.

However, autofs 5

Quoted 1 line

seems much slower than the previous version. It takes

a long time for

Quoted 1 line

autofs to mount my detachable drives. It eventually

happens; it just

Quoted 1 line

takes a long time. Is there a way to improve this

speed? Thanks.

Could you quantify this? What exactly are you doing? Are you sure
autofs is the cause of the sluggishness? Did you upgrade your entire
operating system or just autofs from version 4 to 5? Can you provide a
debug log?

Cheers,

Jeff

#3 lore raw
Quoted 8 lines · Thanh Tran

I upgraded my entire OS from Fedora 5 to 8. By slow, I mean around 20 seconds to detect and mount. There are too many variables. I was hoping it would be a simple polling flag that could be switched in autofs. I can live with the slower time. I did notice that it took a long time only when I physically removed the drive and re-inserted the drive. When I use the "umount" command and not remove the drive, I can quickly change directory back to drive and it mounts in like 2 seconds at most. Thanks for the help.

I'm still a little unclear on your use case. Are you sure you're using autofs to mount your (usb?) drive? This is typically handled by hal in newer distributions.

Cheers,

Jeff

#4 lore raw
Quoted 12 lines · Jeff Moyer <jmoyer <at> redhat.com> writes:
Quoted 8 lines · Thanh Tran <ttran7700 <at> yahoo.com> writes:

I upgraded my entire OS from Fedora 5 to 8. By slow, I mean around 20 seconds to detect and mount. There are too many variables. I was hoping it would be a simple polling flag that could be switched in autofs. I can live with the slower time. I did notice that it took a long time only when I physically removed the drive and re-inserted the drive. When I use the "umount" command and not remove the drive, I can quickly change directory back to drive and it mounts in like 2 seconds at most. Thanks for the help.

Quoted 8 lines

I'm still a little unclear on your use case. Are you sure you're using autofs to mount your (usb?) drive? This is typically handled by hal in newer distributions.

Cheers,

Jeff

I met the same problem. My linux is CentOS 6.4 and installed AutoFS 1.9.2. When I un-plug my USB disk and plug it back, it take a long time (about 20 seconds) to mount the USB drive.

But .... if doing the following step
1. Manually umount the USB drive by command line
2. Un-plug it
3. Plug USB drive back to the PC
4. AutoFS will recognize fast (Within 2 seconds)

Would someone tell me why??

The following is my configuration about AutoFS #-----------<< auto.master >>-----------------------------
/mnt /etc/auto.usb --timeout 1
/net -host
+auto.master
#-----------<< EndOfFile >>-------------------------------

#-----------<< auto.usb >>--------------------------------
usb_disk -fstype=vfat UUID="ECA3-7F95"
#-----------<< EndOfFile >>-------------------------------

Cheers,
Bruce Man

#5 lore raw
In reply to Thanh Tran
Quoted 8 lines · Thanh Tran

I upgraded my entire OS from Fedora 5 to 8. By slow, I mean around 20 seconds to detect and mount. There are too many variables. I was hoping it would be a simple polling flag that could be switched in autofs. I can live with the slower time. I did notice that it took a long time only when I physically removed the drive and re-inserted the drive. When I use the "umount" command and not remove the drive, I can quickly change directory back to drive and it mounts in like 2 seconds at most. Thanks for the help.

It sounds like the issue is with hotplug -- automount can't mount a drive when the kernel doesn't admit that it exists. If you could capture syslog traffic from the kernel at the "debug" level, you could see from the timestamps exactly how long it took to get the USB device alive enough to be mounted. Also, I can easily imagine a race condition in which the device is partially hotplugged, enough that the mount command doesn't fail but does get stuck in some kind of timeout. If you wanted to put a lot of work into the project, you could do this:

Starting with the device unmounted and removed, insert it and simultaneously press enter on a command like this:
time /bin/sh -c "sleep 1 ; ls -ld /media/myusbdrive/."
(the ending /. makes sure that the command cannot finish until the referent is actually mounted -- with "ls /media/myusbdrive" you wonder if an optimization might deliver only confirmation that the mount point is in the /media directory.) Unmount and repeat, varying the sleep time from 1 to 20 secs, and see if there's a specific time, probably about 5 secs, where the long extra delay does not happen.

Jeff Moyer mentioned that most people use HAL and friends to mount hotplugged volumes. I've written up a small "howto" on this topic. See "Jim Carter's Bugfixes",
http://www.math.ucla.edu/~jimc/documents/bugfix.html
about halfway through, the item titled "Automatic Volume Mounting Without KDE or Gnome", and the items following.

James F. Carter Voice 310 825 2897 FAX 310 206 6673
UCLA-Mathnet; 6115 MSA; 520 Portola Plaza; Los Angeles, CA, USA 90095-1555
Email: [email protected] http://www.math.ucla.edu/~jimc (q.v. for PGP key)

author
#6 lore raw

Thanks for all the cool info.

In the past, I have tried to run lshal -monitor. HAL seems to detect my devices just fine and in good speed. I'll try some of your suggestions.

Quoted 3 lines

(the ending /. makes sure that the command cannot finish until the referent
is actually mounted -- with "ls

I never realized you could do this. Beats the heck out of sending the command over and over until the thing is finally mounted.

Quoted 72 lines · Jim Carter

From: Jim Carter <[email protected]>
Subject: Re: [autofs] Is Autofs 5 Slower Than 4
To: "Thanh Tran" <[email protected]>
Cc: "Jeff Moyer" <[email protected]>, [email protected]
Date: Wednesday, August 20, 2008, 12:28 PM

Quoted 1 line · Thanh Tran

I upgraded my entire OS from Fedora 5 to 8. By slow,

I mean around 20

Quoted 1 line

seconds to detect and mount. There are too many

variables. I was hoping

Quoted 1 line

it would be a simple polling flag that could be

switched in autofs. I

Quoted 1 line

can live with the slower time. I did notice that it

took a long time

Quoted 1 line

only when I physically removed the drive and

re-inserted the drive.

Quoted 1 line

When I use the "umount" command and not

remove the drive, I can quickly

Quoted 1 line

change directory back to drive and it mounts in like 2

seconds at most.

Quoted 1 line

Thanks for the help.

It sounds like the issue is with hotplug -- automount can't mount a drive
when the kernel doesn't admit that it exists. If you could capture syslog
traffic from the kernel at the "debug" level, you could see from the
timestamps exactly how long it took to get the USB device alive enough to
be mounted. Also, I can easily imagine a race condition in which the
device is partially hotplugged, enough that the mount command doesn't fail
but does get stuck in some kind of timeout. If you wanted to put a lot of
work into the project, you could do this:

Starting with the device unmounted and removed, insert it and
simultaneously press enter on a command like this:
time /bin/sh -c "sleep 1 ; ls -ld
/media/myusbdrive/."
(the ending /. makes sure that the command cannot finish until the referent
is actually mounted -- with "ls
/media/myusbdrive" you wonder if an
optimization might deliver only confirmation that the mount point is in the
/media directory.) Unmount and repeat, varying the sleep time from 1 to 20
secs, and see if there's a specific time, probably about 5 secs, where
the long extra delay does not happen.

Jeff Moyer mentioned that most people use HAL and friends to mount
hotplugged volumes. I've written up a small "howto" on this topic. See
"Jim Carter's Bugfixes",
http://www.math.ucla.edu/~jimc/documents/bugfix.html
about halfway through, the item titled "Automatic Volume Mounting Without
KDE or Gnome", and the items following.

James F. Carter Voice 310 825 2897 FAX 310 206
6673
UCLA-Mathnet; 6115 MSA; 520 Portola Plaza; Los Angeles, CA, USA 90095-1555
Email: [email protected] http://www.math.ucla.edu/~jimc
(q.v. for PGP key)