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

Zhitao Li zhitaoli1201 at outlook.com
Fri Mar 17 12:01:50 UTC 2017


Thanks for your kind reply.


In fact, I am in the worst case: all 10000 files in the mount point without using sub-directories. About 436 times fuse_getattr(lookup) need to be called, and 3ms a time(md_cache always miss). That is why fuse_getattr(lookup) takes so high cost.


Could you tell more about the reason for which the "nodeid==1" need to be checked?  You said "The check makes sure that there is a LOOKUP done on the root of the volume ("/" always has inode "1",GFID "00000000-0000-0000-0000-000000000001"). "

Now I disable the special check, meaning that lookup operation will  be replaced by stat operation? Both will return correct  result to fuse-kernel? What if without the check?

It works normally now. Could you tell me some cases where it doesn't work?


Thank you!



Best regards,
Zhitao Li

Sent from Outlook<http://aka.ms/weboutlook>
________________________________
From: Niels de Vos <ndevos at redhat.com>
Sent: Friday, March 17, 2017 6:12:35 PM
To: Zhitao Li
Cc: gluster-devel at gluster.org; Zhitao Li; 1318078301 at qq.com
Subject: Re: [Gluster-devel] Why nodeid==1 need to be checked and dealt with specially in "fuse-bridge.c"?

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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.gluster.org/pipermail/gluster-devel/attachments/20170317/f21f3b69/attachment.html>


More information about the Gluster-devel mailing list