<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Verdana","sans-serif";
        color:windowtext;
        font-weight:normal;
        font-style:normal;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:253326929;
        mso-list-type:hybrid;
        mso-list-template-ids:-2102862230 743702876 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Verdana","sans-serif";
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>We
are using GFS to store session files for our web application.  I've spent
some time exploring GFS performance and tuning the software for optimal latency
on system calls—we control the software, and the core libraries are
written in C.  So I've been following related discussions of e.g. stat()
performance with a great deal of interest.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>I
hit a wall reducing latency of new file creation.  Average create times
are around 10ms and fluctuate from about 1ms up to 100ms or so.  
Here's an example:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'>open("/tb2/session/localhost/1800/ac18c/379/905bbc40.ts",
O_WRONLY|O_CREAT|O_EXCL, 0660) = 4 <0.015415><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>The
parent directory of this file (379) was created on this node.  Our session
storage ensures that no two nodes will attempt to create files in the same
directory. I'm also limiting the number of directories we have to create so there
is about a 50:1 ratio of files to directories (mkdir performance on GFS is
generally awful).<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Here's
a breakdown of the most common system calls made from my test harness:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'>% time     seconds 
usecs/call     calls    errors syscall<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'>------ ----------- ----------- --------- ---------
----------------<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'> 91.26   
0.046362        
228      
203           open<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'>  7.87   
0.003998       
1999        
2           mkdir<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'>  0.59   
0.000298          
0      
600         2 stat<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'>  0.19    0.000098           0      
200           write<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'>  0.09   
0.000045          
0      
302           read<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'>  0.00   
0.000000          
0      
202           close<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Note
this report doesn't show wall-clock time  (I obtained it with strace –c). 
Roughly half the calls to open() are creating files, the rest open existing
files.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>My
questions:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><span
style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>     
</span></span></span><![endif]><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>What
exactly happens during open()?  I'm guessing that at least the journal is
flushed to disk.  Timings for open() are long and highly variable compared
to other filesystems (e.g. ext3).  The strace utility is limited to showing
system calls from user space—it'd be interesting to see what I/O takes
place in kernel space, but I don't have any way to do that (do I?).  Am I
network bound or I/O bound here?  The latency looks suspiciously like disk
seek times to me.<o:p></o:p></span></p>

<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><span
style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>     
</span></span></span><![endif]><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Is
there a strategy I can use to return more quickly from open() on a GFS
filesystem?<o:p></o:p></span></p>

<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><span
style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>     
</span></span></span><![endif]><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Before
I spend time migrating to GFS2, is there any reason to believe GFS2 would perform
significantly better here?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Thanks,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Jeff<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p> </o:p></span></p>

</div>

</body>

</html>