<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p><span style="font-size:10pt">Thanks for your kind reply. </span></p>
<p><span style="font-size:10pt"><br>
</span></p>
<p><span style="font-size:10pt">In fact, I am in the worst case: all 10000 files in the mount point without using sub-directories. </span><span style="font-size:10pt">About 436 times fuse_getattr(lookup</span><span style="font-size:10pt">) need to be called,
and 3ms a time(md_cache always miss). That is why fuse_getattr(lookup) takes so high cost. </span></p>
<p><br>
</p>
<p><span style="font-size:10pt">Could you tell more about the reason for which the "nodeid==1" need to be checked? You said </span>"<span style="color:rgb(33,33,33); font-size:13.3333px">The check makes sure that there </span><span style="color:rgb(33,33,33); font-size:13.3333px">is
a LOOKUP done on the root of the volume ("/" always has inode "1",</span><span style="color:rgb(33,33,33); font-size:13.3333px">GFID "00000000-0000-0000-0000-000000000001"). "</span></p>
<p><font color="#212121"><span style="font-size:13.3333px">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? </span></font></p>
<p><span style="font-size:13.3333px; color:rgb(33,33,33)">It works normally now. Could you tell me some cases where it doesn't work?</span><br>
</p>
<p><font color="#212121"><span style="font-size:13.3333px"><br>
</span></font></p>
<p><font color="#212121"><span style="font-size:13.3333px">Thank you!</span></font></p>
<p><br>
</p>
<p><br>
</p>
<div id="x_Signature">
<div style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
</div>
<span style="font-size:10pt"></span>
<div style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="font-size:10pt">Best regards,</span></div>
<span style="font-size:10pt"></span>
<div style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="font-size:10pt">Zhitao Li</span></div>
<span style="font-size:10pt"></span>
<div style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="font-size:10pt"> </span></div>
<span style="font-size:10pt"></span>
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="font-size:10pt">Sent from </span><a href="http://aka.ms/weboutlook" id="LPNoLP"><span style="font-size:10pt">Outlook</span></a></div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Niels de Vos <ndevos@redhat.com><br>
<b>Sent:</b> Friday, March 17, 2017 6:12:35 PM<br>
<b>To:</b> Zhitao Li<br>
<b>Cc:</b> gluster-devel@gluster.org; Zhitao Li; 1318078301@qq.com<br>
<b>Subject:</b> Re: [Gluster-devel] Why nodeid==1 need to be checked and dealt with specially in "fuse-bridge.c"?</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">On Thu, Mar 16, 2017 at 10:26:25AM +0000, Zhitao Li wrote:<br>
> Hello, everyone,<br>
> <br>
> <br>
> I have been trying to optimize "ls" performance for Glusterfs<br>
> recently. My volume is disperse(48 bricks with redundancy 16), and I<br>
> mount it with fuse. I create 10000 little files in mount point. Then I<br>
> execute "ls" command. In my cluster, it takes about 3 seconds.<br>
> <br>
> I have a question about fuse_getattr function in "fuse-bridge.c" . Why<br>
> need we check whether nodeid is equal to 1? , which means it is the<br>
> mount point. It is hard for me to get its meaning.<br>
> <br>
> (In my case, I find the operation of fuse_getattr takes neer half time<br>
> for "ls", that is why I want to know what the check means. )<br>
> <br>
> <br>
> [<a href="http://mail.163.com/js6/s?func=mbox:getMessageData&sid=iCMbFXtmOmngEsSJqWmmoeUvPJvoWUxS&mid=89:1tbiWQWbqlWBWYAhhQAAsE&part=3">http://mail.163.com/js6/s?func=mbox:getMessageData&sid=iCMbFXtmOmngEsSJqWmmoeUvPJvoWUxS&mid=89:1tbiWQWbqlWBWYAhhQAAsE&part=3</a>]<br>
> <br>
> <br>
> <br>
> <br>
> I try to disable the special check, and then test "ls". It works<br>
> normally and have a speedup 2x(about 1.3s without check). The reason<br>
> is that in my case, "lookup" cost is much higher than "stat". Without<br>
> the special check, getattr goes into "stat" instead of "lookup".<br>
> <br>
> <br>
> Could you tell me the meaning of the special check for "nodeid == 1"?<br>
<br>
I'm not sure of check in fuse_getattr would account for the<br>
huge performance loss/win in your test. The check makes sure that there<br>
is a LOOKUP done onf the root of the volume ("/" always has inode "1",<br>
GFID "00000000-0000-0000-0000-000000000001"). In the majority of the<br>
cases this should be skipped, unless you run your tests withour using a<br>
sub-directory.<br>
<br>
You can use 'gluster volume profile' to get some additional performance<br>
statistics. For simple (single brick, or distribution only) volumes, you<br>
can also use Wireshark (and "tshark -o srt,...") to see what goes over<br>
the (slow) network.<br>
<br>
HTH,<br>
Niels<br>
</div>
</span></font>
</body>
</html>