nsstest - test nsswitch (and nss_ndb) functionality
nsstest [options]action[arguments]
This manual page documents briefly the nsstest command.
nsstest is a tool that can be used to test and measure
latency in nsswitch lookups (currently only for passwd & group
databases). The normal (non ndb_xx) actions tests the whole chain so can be
used to test the speed of other nsswitch backends.
- -h
- Show summary of options.
- -v
- Increase verbosity.
- -x
- Expect failure (give error if not failed)
- -c
- Validate returned data
- -s
- Keep database(s) open (setpwent, setgrent)
- -C text
- Compare returned data
- -B bytes
- Buffer size [default: 1048576 bytes]
- -T seconds
- Timeout limit [default: 2 s]
- -N times
- Repeat test [default: 0 times]
- -P threads
- Run in parallel [default: 0 (single-threaded)]
Test the various library calls (or ndb directly for the ndb_xxx actions). The
argument is typically the user/group name or uid/gids needed.
- getpwnam user-name
- getpwnam_r user-name
- getpwuid uid
- getpwuid_r uid
- getpwent
- getpwent_r
- getgrnam group-name
- getgrnam_r group-name
- getgrgid gid
- getgrgid_r gid
- getgrent
- getgrent_r
- getgrouplist user-name
- ndb_getpwnam_r user-name
- ndb_getpwuid_r uid
- ndb_getgrnam_r group-name
- ndb_getgrgid_r gid
-
- Single-Threaded username lookups in passwd database
-
$ nsstest getpwnam peter
Call results:
Calls: 38561
Time: 2.00 s
Time/call: 51.87 µs
Test results:
Min: 47.68 µs/c
Avg: 51.87 µs/c
Max: 870.70 µs/c
- Multi-threaded (4 threads) parallel group lookups in group
database
-
$ nsstest -P 4 getgrnam_r employees
Call results:
Calls: 79659
Time: 2.00 s
Time/call: 25.16 µs
Test results:
Min: 78.92 µs/c
Avg: 100.44 µs/c
Max: 2.03 ms/c
-
-
$ nsstest -P10 -s -x ndb_getpwnam_r no-such-user
Call results:
Calls: 237570
Time: 2.01 s
Time/call: 8.45 µs
Test results:
Min: 34.57 µs/c
Avg: 84.20 µs/c
Max: 1.01 ms/c
nss_ndb(8), makendb(8), nss_ndb.conf(5),
nsswitch.conf(5), nsdispatch(3),
https://github.com/ptrrkssn/nss_ndb
nss_ndb and tools was written by Peter Eriksson
<pen@lysator.liu.se>.