<div dir="ltr"><div>Hi</div>it is depend on the application. The extreme example is dd. <div>A command like: <span style="font-family:Menlo;font-size:11px">dd if=/dev/zero of=test3 bs=1M count=10</span></div><div><span style="font-family:Menlo;font-size:11px">is generating only 1 open and 1 close</span></div><div><span style="font-family:Menlo;font-size:11px"><br></span></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">[root@st30-mds2 lustre]# cat ./mdt/Lustre01-MDT0000/md_stats</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">snapshot_time             1453835751.924029 secs.usecs</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">open                      1 samples [reqs]</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">close                     1 samples [reqs]</p></div><div><br></div><div><br></div><div>but if you have set a layout in advance using las setstripe you get:</div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"># lfs setstripe -c -1 test4</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"># dd if=/dev/zero of=test4 bs=1M count=10</p></div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">[root@st30-mds2 lustre]# cat ./mdt/Lustre01-MDT0000/md_stats</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">snapshot_time             1453835949.562825 secs.usecs</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">open                      3 samples [reqs]</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">close                     3 samples [reqs]</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">setattr                   1 samples [reqs]</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">getxattr                  1 samples [reqs]</p></div><div><br></div><div>2 opens and 2 close and 1 getxattr for the las command</div><div>1 open and 1 close for the dd</div><div>1 setattr for the special layout</div><div><br></div><div>.... so let's strace your app and see why there are so many getattr.... modern version of lustre can get advantage of local matter cache... take a look at:</div><div><span style="font-family:Menlo;font-size:11px">lctl get_param llite.*.xattr_cache</span> </div><div><br></div><div><br></div><div><span style="font-family:Menlo;font-size:11px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 21 January 2016 at 05:05,  <span dir="ltr"><<a href="mailto:Prakrati.Agrawal@shell.com" target="_blank">Prakrati.Agrawal@shell.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="color:#1f497d">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">The thing I want an understanding of is, if my file is say striped across OSTs, number of getattr() calls will be equivalent to the number of OSTs if I am opening a single file.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">I observed that there is 1 open and close op in the ganglia monitoring page on MDT but getattr calls are 10 for the same time. I am unable to understand the reason for this.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Thanks and Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Prakrati<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Patrick Farrell [mailto:<a href="mailto:paf@cray.com" target="_blank">paf@cray.com</a>]
<br>
<b>Sent:</b> Wednesday, January 20, 2016 9:26 AM<br>
<b>To:</b> Agrawal, Prakrati PTIN-PTT/ICOE; <a href="mailto:lustre-discuss@lists.lustre.org" target="_blank">lustre-discuss@lists.lustre.org</a><br>
<b>Subject:</b> RE: When is getattr() called<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">Getattr is returning file attributes, so it's going to be called as part of any browsing (ls, depending on options) or scanning (find, du, or perhaps RobinHood)
 of the file system.  Also, many libraries will do getattr calls before doing an open, as part of sanity checking a file.
<u></u><u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">- Patrick<u></u><u></u></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:black">
<hr size="2" width="100%" align="center">
</span></div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black"> lustre-discuss [<a href="mailto:lustre-discuss-bounces@lists.lustre.org" target="_blank">lustre-discuss-bounces@lists.lustre.org</a>]
 on behalf of <a href="mailto:Prakrati.Agrawal@shell.com" target="_blank">Prakrati.Agrawal@shell.com</a> [<a href="mailto:Prakrati.Agrawal@shell.com" target="_blank">Prakrati.Agrawal@shell.com</a>]<br>
<b>Sent:</b> Tuesday, January 19, 2016 9:49 PM<br>
<b>To:</b> <a href="mailto:lustre-discuss@lists.lustre.org" target="_blank">lustre-discuss@lists.lustre.org</a><br>
<b>Subject:</b> [lustre-discuss] When is getattr() called</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:black"><u></u><u></u></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:black">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">I was looking at the MDT parameters on Ganglia and there is a graph which shows getattr calls and that is very high as compared to open and close calls. Under what scenarios, is getattr called.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">Thanks and Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">Prakrati <u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></div>
</div>

<br>_______________________________________________<br>
lustre-discuss mailing list<br>
<a href="mailto:lustre-discuss@lists.lustre.org">lustre-discuss@lists.lustre.org</a><br>
<a href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org" rel="noreferrer" target="_blank">http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">www: <a href="http://paciucci.blogspot.com" target="_blank">http://paciucci.blogspot.com</a></div>
</div>