bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Poor find performance on Solaris / nscd / ldap


From: Philip Rowlands
Subject: Poor find performance on Solaris / nscd / ldap
Date: Tue, 13 Mar 2012 22:38:42 +0000 (GMT)
User-agent: Alpine 2.02 (LFD 1266 2009-07-14)

Trying to search through homedir files to tidy, I thought I'd be better running on the NFS server itself, rather than all those network round trips. However, GNU find on Solaris 10 has some unexpected and noticably slow interactions with the NSS / nscd / LDAP layers.

address@hidden find]$ ./find --version
find (GNU findutils) 4.5.10
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Built using GNU gnulib version 25d7f3a59bfdc7aaca4a016f687826883a55bef3
Features enabled: O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD)
CBO(level=2)

$ mount | grep tmp
/tmp on swap read/write/setuid/devices/xattr/size=5734m/dev=48c0002 on
Tue Jun 14 18:56:29 2011

$ uname -a
SunOS my.hostname.com 5.10 Generic_141445-09 i86pc i386 i86pc

$ mkdir /tmp/findtest
$ touch /tmp/findtest/{a,b,c}
$ truss -c ./find /tmp/findtest -printf '%M %u %g %p\n'
drwxr-xr-x rowlap rowlap /tmp/findtest
-rw-r--r-- rowlap rowlap /tmp/findtest/a
-rw-r--r-- rowlap rowlap /tmp/findtest/b
-rw-r--r-- rowlap rowlap /tmp/findtest/c
# snip
syscall               seconds   calls  errors
sys totals:              .009    2652     70

$ truss -c /bin/ls -lR /tmp/findtest
/tmp/findtest:
total 0
-rw-r--r--   1 rowlap   rowlap         0 Mar 13 16:23 a
-rw-r--r--   1 rowlap   rowlap         0 Mar 13 16:23 b
-rw-r--r--   1 rowlap   rowlap         0 Mar 13 16:23 c
#snip
syscall               seconds   calls  errors
sys totals:              .003     905     25

Reasoning that ls -lR would require approximately the same number of syscalls as find -printf '%M %u %g %p\n', even with the overhead of talking to the LDAP server, find does much worse. For comparison on Linux, with similar NSS / LDAP setup, both find and ls do better, using 121 / 187 syscalls respectively to give the same output.

Although I'm curious why Solaris' libc/libldap is doing this much work, how could GNU find's use of the same libc calls be so 4 times more expensive, when translated to syscalls?

Would it be useful to post detailed truss / truss -u captures? They're quite long, due to the LDAP queries.


Cheers,
Phil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]