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

Zhitao Li zhitaoli1201 at outlook.com
Wed Mar 15 16:43:37 UTC 2017


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. )


[cid:7b3a479d-5cd6-4c3a-bc94-8c0e18d0f0c7]




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 would appreciate it if anyone could give some tips . Thank you!

Best regards,
Zhitao Li

Sent from Outlook<http://aka.ms/weboutlook>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20170315/cfd9cb2a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 71684 bytes
Desc: pastedImage.png
URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20170315/cfd9cb2a/attachment.png>


More information about the Gluster-users mailing list