[Gluster-devel] Why nodeid==1 need to be checked and dealt with specially in "fuse-bridge.c"?

Niels de Vos ndevos at redhat.com
Fri Mar 17 10:12:35 UTC 2017


On Thu, Mar 16, 2017 at 10:26:25AM +0000, Zhitao Li wrote:
> Hello, everyone,
> 
> 
> I have been trying to optimize "ls" performance for Glusterfs
> recently. My volume is disperse(48 bricks  with redundancy 16), and I
> mount it with fuse. I create 10000 little files in mount point. Then I
> execute "ls" command. In my cluster, it takes about 3 seconds.
> 
> I have a question about fuse_getattr function in "fuse-bridge.c" . Why
> need we check whether nodeid is equal to 1? , which means it is the
> mount point.  It is hard for me to get its meaning.
> 
> (In my case, I find the operation of fuse_getattr takes neer half time
> for "ls", that is why I want to know what the check means. )
> 
> 
> [http://mail.163.com/js6/s?func=mbox:getMessageData&sid=iCMbFXtmOmngEsSJqWmmoeUvPJvoWUxS&mid=89:1tbiWQWbqlWBWYAhhQAAsE&part=3]
> 
> 
> 
> 
> I try to disable the special check, and then test "ls". It works
> normally and have a speedup 2x(about 1.3s without check). The reason
> is that in my case, "lookup" cost is much higher than "stat". Without
> the special check, getattr goes into "stat" instead of "lookup".
> 
> 
> Could you tell me the meaning of the special check for "nodeid == 1"?

I'm not sure of check in fuse_getattr would account for the
huge performance loss/win in your test. The check makes sure that there
is a LOOKUP done onf the root of the volume ("/" always has inode "1",
GFID "00000000-0000-0000-0000-000000000001"). In the majority of the
cases this should be skipped, unless you run your tests withour using a
sub-directory.

You can use 'gluster volume profile' to get some additional performance
statistics. For simple (single brick, or distribution only) volumes, you
can also use Wireshark (and "tshark -o srt,...") to see what goes over
the (slow) network.

HTH,
Niels
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.gluster.org/pipermail/gluster-devel/attachments/20170317/28ccb943/attachment.sig>


More information about the Gluster-devel mailing list