Bug 1694943

Summary: parallel-readdir slows down directory listing
Product: [Community] GlusterFS Reporter: Nithya Balachandran <nbalacha>
Component: coreAssignee: bugs <bugs>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, pasik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-12 12:13:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nithya Balachandran 2019-04-02 06:38:07 UTC
Description of problem:
While running tests with the upstream master (HEAD at commit dfa255ae7f2dab4fb3d84c67a0452c5b32455877), I noticed that enabling parallel-readdir seems to increase the time taken for a directory listing:


Numbers from a pure distribute 3 brick volume:

Volume Name: pvol
Type: Distribute
Volume ID: c39c8c16-82d3-4b0b-8050-9c3d22c800ea
Status: Started
Snapshot Count: 0
Number of Bricks: 3
Transport-type: tcp
Bricks:
Brick1: server1:/mnt/bricks/fsgbench0002/brick-0
Brick2: server1:/mnt/bricks/fsgbench0003/brick-0
Brick3: server1:/mnt/bricks/fsgbench0004/brick-0
Options Reconfigured:
transport.address-family: inet
nfs.disable: on



The volume was mounted on /mnt/nithya and I created 10K directories and 10K files in the volume root:


With readdir-ahead enabled:
----------------------------
[root@server2 nithya]# time ll |wc -l
20001

real	0m11.434s
user	0m0.116s
sys	0m0.241s
[root@server2 nithya]# time ll |wc -l
20001

real	0m6.825s
user	0m0.111s
sys	0m0.265s




With readdir-ahead and parallel-readdir enabled:
------------------------------------------------

[root@server2 nithya]# time ll |wc -l
20001

real	0m15.609s
user	0m0.148s
sys	0m0.379s
[root@server2 nithya]# time ll |wc -l
20001

real	0m9.930s
user	0m0.107s
sys	0m0.295s

Comment 2 Worker Ant 2020-03-12 12:13:21 UTC
This bug is moved to https://github.com/gluster/glusterfs/issues/842, and will be tracked there from now on. Visit GitHub issues URL for further details