<br><font size=2 face="sans-serif">Andreas - Here is a snipet of the strace
output. </font>
<br>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">read(3, &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;...,
2097152) = 2097152</font>
<br><font size=2 face="Courier New">_llseek(3, 0, [0], SEEK_SET) &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0</font>
<br><font size=2 face="Courier New">read(3, &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;...,
2097152) = 2097152</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">read(3, &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;...,
2097152) = 2097152</font>
<br><font size=2 face="Courier New">_llseek(3, 0, [0], SEEK_SET) &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0</font>
<br><font size=2 face="Courier New">read(3, &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;...,
2097152) = 2097152</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">read(3, &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;...,
2097152) = 2097152</font>
<br><font size=2 face="Courier New">_llseek(3, 0, [0], SEEK_SET) &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0</font>
<br><font size=2 face="Courier New">read(3, &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;...,
2097152) = 2097152</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">read(3, &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;...,
2097152) = 2097152</font>
<br><font size=2 face="Courier New">_llseek(3, 0, [0], SEEK_SET) &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0</font>
<br><font size=2 face="Courier New">read(3, &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;...,
2097152) = 2097152</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">read(3, &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;...,
2097152) = 2097152</font>
<br><font size=2 face="Courier New">_llseek(3, 0, [0], SEEK_SET) &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0</font>
<br><font size=2 face="Courier New">read(3, &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;...,
2097152) = 2097152</font>
<br><font size=2 face="Courier New">_llseek(3, 2097152, [2097152], SEEK_SET)
= 0</font>
<br><font size=2 face="Courier New">read(3, &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;...,
2097152) = 2097152</font>
<br><font size=2 face="Courier New">_llseek(3, 0, [0], SEEK_SET) &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0</font>
<br><font size=2 face="sans-serif"><br>
Thanks again</font>
<br>
<br><font size=2 face="sans-serif">Rocky <br>
<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Andreas Dilger &lt;andreas.dilger@oracle.com&gt;</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">Ronald K Long &lt;rklong@usgs.gov&gt;</font>
<tr>
<td valign=top><font size=1 color=#5f5f5f face="sans-serif">Cc:</font>
<td><font size=1 face="sans-serif">lustre-discuss@lists.lustre.org</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">04/13/2010 11:50 PM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">Re: [Lustre-discuss] fseeks on lustre</font></table>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>On 2010-04-13, at 07:59, Ronald K Long wrote:<br>
&gt; We are doing SEEK_SET<br>
&gt;<br>
&gt; fseek(fp,offset[i],SEEK_SET<br>
&gt;<br>
&gt; We were running into this same issue on our san file system until
we &nbsp;<br>
&gt; set the dma_cache_read_ahead to match our buffer size of 256k. &nbsp;Just
&nbsp;<br>
&gt; wondering if there is away to set that within lustre. &nbsp;We are
&nbsp;<br>
&gt; running 1.8 on the MDS and OSS and the clients running the fseek are
&nbsp;<br>
&gt; are running 1.6.<br>
<br>
Sorry, I didn't read enough into your question. &nbsp;When you said &nbsp;<br>
&quot;opening a large file and doing fseek()&quot; I thought that was the
only &nbsp;<br>
thing you are doing, but really you are doing IOs after the fseek() &nbsp;<br>
that is presumably what is taking a long time.<br>
<br>
It's true that if you are doing random reads it may cause sub-optimal &nbsp;<br>
performance because the client cannot do readahead to mitigate the &nbsp;<br>
network/disk latency.<br>
<br>
One problem that we saw some time ago at another customer was that &nbsp;<br>
their application doing random IO was getting the &quot;IO blocksize&quot;
from &nbsp;<br>
the file via {f,}stat() and reading from the file in chunks of &nbsp;<br>
st_blksize. &nbsp;Since Lustre returns st_blksize = 2MB, then the &nbsp;<br>
application wanting 4kB chunks of random data from the file was &nbsp;<br>
seeking and reading 2MB of extra data for each seek.<br>
<br>
It would be worthwhile to strace your application to see if it is &nbsp;<br>
doing the same thing.<br>
<br>
&gt; Andreas Dilger &lt;andreas.dilger@oracle.com&gt; wrote:<br>
&gt;&gt; On 2010-04-07, at 14:09, Ronald K Long wrote:<br>
&gt;&gt; &gt; I am having an issue with our lustre file system. &nbsp;In
our current<br>
&gt;&gt; &gt; environment on a san file system opening a large file and
doing<br>
&gt;&gt; &gt; fseeks completes in under 2 seconds. &nbsp;Running that same
routine on<br>
&gt;&gt; &gt; our lustre file system the routine actually never finishes.<br>
&gt;&gt;<br>
&gt;&gt; Doing fseek() itself is only a client-side operation, so it should<br>
&gt;&gt; have no performance impact, UNLESS you are doing SEEK_END, which<br>
&gt;&gt; requires that the actual file size be computed on the client.
&nbsp;That<br>
&gt;&gt; causes lock revocation from all of the clients and is an expensive<br>
&gt;&gt; operation. &nbsp;Using SEEK_CUR or SEEK_SET has no cost at all.<br>
&gt;&gt;<br>
&gt;&gt; &gt; Are there any tunable parameter in lustre that can alleviate
this<br>
&gt;&gt; &gt; problem?<br>
&gt;&gt;<br>
&gt;&gt; It depends on what the problem really is.<br>
<br>
<br>
Cheers, Andreas<br>
--<br>
Andreas Dilger<br>
Principal Engineer, Lustre Group<br>
Oracle Corporation Canada Inc.<br>
<br>
</font></tt>
<br>
<br>