Ticket #30 (closed bug: fixed)

Opened 2 months ago

Last modified 4 weeks ago

performance bug in readdirplus()

Reported by: carns Assigned to: carns
Priority: major Component: SERVER
Version: 2.7.0 Keywords: lsplus readdirplus performance
Cc:

Description

sys_readdirplus() is slower than sys_readdir()/sys_getattr() calls if full attributes are requested. This gap is very large when using multiple clients to concurrently list large directories.

Reproducible with a more modest performance difference when using pvfs2-{ls/lsplus} on a single client with a single server and 1000 empty files:

$ time ./pvfs2-ls -alh /mnt/pvfs2/testdir/ > /dev/null

real    0m0.603s
user    0m0.172s
sys     0m0.092s
$ time ./pvfs2-lsplus -alh /mnt/pvfs2/testdir/ > /dev/null

real    0m0.812s
user    0m0.100s
sys     0m0.028s

Change History

04/02/08 16:54:27 changed by carns

  • status changed from new to assigned.

Also observed that this problem is present in both trunk (which uses pjmp) and pvfs-2-7-branch.

At first glance it appears to be a server side problem because the CPU load on the server is maxed out during heaving sys_readdirplus() activity, while the client is mostly idle.

04/03/08 11:10:32 changed by carns

Found that the trove getattr_list() routine was doing expensive unnecessary work that dated back to an old dbpf format. After removing this code, the same ls tests as from the initial ticket description show this:

$ time ./pvfs2-ls -alh /mnt/pvfs2/testdir/ > /dev/null

real    0m0.610s
user    0m0.188s
sys     0m0.092s
$ time ./pvfs2-lsplus -alh /mnt/pvfs2/testdir/ > /dev/null

real    0m0.193s
user    0m0.096s
sys     0m0.044s

This is a a greater than 4x improvement in pvfs2-lsplus time in the single server, single client case, and now gives the expected result that readdirplus() is indeed faster than readdir()/getattr().

Will look into consolidating the service logic for getattr() and getattr_list() before merging changes to 2.7 branch.

04/23/08 08:59:12 changed by carns

  • status changed from assigned to closed.
  • resolution set to fixed.