bugfindutils - Bugs: bug #17372, fts-based find very slow on NFS

 
 

bug #17372: fts-based find very slow on NFS

Submitted by:  James Youngman <jay>
Submitted on:  Tue 08 Aug 2006 05:50:16 PM UTC  
 
Category: findSeverity: 2 - Minor
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Open/Closed: Closed
Release: 4.3.1Fixed Release: 4.3.2

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 08 Aug 2006 10:09:23 PM UTC, comment #3:

I believe that the attached patch fixes the problem without introducing any regressions.

James Youngman <jay>
Project AdministratorIn charge of this item.
Tue 08 Aug 2006 06:12:03 PM UTC, comment #2:

Oops, I mean -maxdepth not -depth

James Youngman <jay>
Project AdministratorIn charge of this item.
Tue 08 Aug 2006 06:09:07 PM UTC, comment #1:

It could just be that -depth is wrongly implemented in ftsfind.c:-

$ for find in /usr/bin/find find oldfind-dev find-dev ; do echo; echo $find : $( $find --version | sed -e 1q); strace -e lstat64 $find /tmp/X -maxdepth 1 -perm 0 -false -print ; done ; echo ; echo Layout:; find /tmp/X

/usr/bin/find : GNU find version 4.1.20
lstat64(".", {st_mode=S_IFDIR|0711, st_size=32768, ...}) = 0
lstat64("/tmp/X", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat64(".", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat64(".", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat64(".", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat64("Y", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0

find : GNU find version 4.2.29-CVS
lstat64(".", {st_mode=S_IFDIR|0711, st_size=32768, ...}) = 0
lstat64("X", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat64("Y", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0

oldfind-dev : GNU find version 4.3.2-CVS
lstat64(".", {st_mode=S_IFDIR|0711, st_size=32768, ...}) = 0
lstat64("X", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat64("Y", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0

find-dev : GNU find version 4.3.2-CVS
lstat64("/tmp/X", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat64("Y", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat64("Z", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat64("ZZ", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat64("ZZZ", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat64("q", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0

Layout:
/tmp/X
/tmp/X/Y
/tmp/X/Y/Z
/tmp/X/Y/Z/P
/tmp/X/Y/ZZ
/tmp/X/Y/ZZZ
/tmp/X/Y/q

James Youngman <jay>
Project AdministratorIn charge of this item.
Tue 08 Aug 2006 05:50:16 PM UTC, original submission:

In find version 4.3.1, the fts-based version of find works very slowly on NFS. In this example, it's well over 20 times slower:-

$ time oldfind-dev /dir -maxdepth 2 -name wireless
[...]
real 0m3.348s
user 0m0.004s
sys 0m0.060s
$ time find-dev /home/build -maxdepth 2 -name wireless 2>/dev/null
[...]
real 1m47.342s
user 0m0.064s
sys 0m0.624s

Using -O3 doesn't help. It looks like the fts implementation stats dramatically more files.

James Youngman <jay>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #10494:  ftsfind-maxdepth-efficiency.patch added by jay (917B - text/x-diff - Patch 1)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 30 Nov 2006 11:58:33 PM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.3.2
    Tue 08 Aug 2006 10:09:23 PM UTCjayStatusConfirmed=>Fixed
      Attached File-=>Added ftsfind-maxdepth-efficiency.patch, #10494

    Back to the top


    Powered by Savane 3.1-cleanup1