<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><br><br><br>Hi&nbsp;<span class="Apple-style-span" style="white-space: pre-wrap; ">Vennlig&nbsp;hilsen</span><div><span class="Apple-style-span" style="white-space: pre-wrap;">     Thanks for your reply.</span></div><div><span class="Apple-style-span" style="white-space: pre-wrap;">     For the Glusterfs write cache, there is clearly description in the document of "performance in gluster" that was released by Gluster, it said that in order to avoid the memory cache coherency</span></div><div><span class="Apple-style-span" style="white-space: pre-wrap;">problem, then didn't use write cache in the client end.</span></div><div><span class="Apple-style-span" style="white-space: pre-wrap;">     There is another thing make me confuse is what's the difference between O_SYNC and O_DIRECT. As we all know,O_DIRECT will not use any cache, O_SYNC means the read/write process will be blocked until the request operation complete. Does the O_SYNC options use any cache? or not use? For the small size file operation, which access mode should we use to avoid the memory cache influence? O_SYNC or O_DIRECT? <br></span><br><div></div><div id="divNeteaseMailCard"></div>&nbsp; &nbsp; &nbsp; &nbsp;Lixin Niu<br><pre><br>At&nbsp;2013-03-18&nbsp;18:59:03,"Torbjørn&nbsp;Thorsen"&nbsp;&lt;torbjorn@trollweb.no&gt;&nbsp;wrote:
&gt;On&nbsp;Mon,&nbsp;Mar&nbsp;18,&nbsp;2013&nbsp;at&nbsp;11:27&nbsp;AM,&nbsp;nlxswig&nbsp;&lt;nlxswig@126.com&gt;&nbsp;wrote:
&gt;&gt;&nbsp;Hi&nbsp;guys
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1:&nbsp;What&nbsp;kind&nbsp;of&nbsp;benchmark&nbsp;should&nbsp;I&nbsp;use&nbsp;to&nbsp;test&nbsp;the&nbsp;small&nbsp;file&nbsp;operation
&gt;&gt;&nbsp;?
&gt;
&gt;I've&nbsp;been&nbsp;wondering&nbsp;a&nbsp;bit&nbsp;about&nbsp;the&nbsp;same&nbsp;thing.
&gt;I&nbsp;was&nbsp;thinking&nbsp;it&nbsp;would&nbsp;be&nbsp;nice&nbsp;to&nbsp;have&nbsp;something&nbsp;record&nbsp;and
&gt;synthesize&nbsp;IO&nbsp;patterns.
&gt;One&nbsp;could&nbsp;record&nbsp;a&nbsp;process&nbsp;which&nbsp;does&nbsp;a&nbsp;lot&nbsp;of&nbsp;handling&nbsp;of&nbsp;small
&gt;files,&nbsp;for&nbsp;example&nbsp;Dovecot,
&gt;and&nbsp;be&nbsp;able&nbsp;to&nbsp;replay&nbsp;those&nbsp;IO&nbsp;patterns&nbsp;on&nbsp;top&nbsp;of&nbsp;any&nbsp;filesystem.
&gt;
&gt;A&nbsp;quick&nbsp;look&nbsp;around&nbsp;revealed&nbsp;ioreplay[1].
&gt;It&nbsp;seems&nbsp;to&nbsp;work&nbsp;by&nbsp;replaying&nbsp;strace&nbsp;output,&nbsp;which&nbsp;is&nbsp;cool&nbsp;idea.
&gt;I&nbsp;haven't&nbsp;tried&nbsp;it,&nbsp;but&nbsp;it&nbsp;looks&nbsp;to&nbsp;be&nbsp;a&nbsp;nice&nbsp;testing&nbsp;tool.
&gt;
&gt;[1]:&nbsp;https://code.google.com/p/ioapps/wiki/ioreplay
&gt;
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4:&nbsp;From&nbsp;the&nbsp;glusterfs&nbsp;document,&nbsp;I&nbsp;get&nbsp;that&nbsp;in&nbsp;order&nbsp;to&nbsp;avoid&nbsp;the&nbsp;cache
&gt;&gt;&nbsp;coherency&nbsp;there&nbsp;is&nbsp;no&nbsp;write&nbsp;cache&nbsp;feature.
&gt;&gt;
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Does&nbsp;it&nbsp;mean&nbsp;that&nbsp;there&nbsp;is&nbsp;no&nbsp;inference&nbsp;of&nbsp;memory&nbsp;cache&nbsp;for&nbsp;small
&gt;&gt;&nbsp;file&nbsp;write&nbsp;performance&nbsp;of&nbsp;glusterfs?
&gt;&gt;
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;So,&nbsp;when&nbsp;we&nbsp;testing&nbsp;glusterfs&nbsp;with:
&gt;&gt;
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"dd&nbsp;if=/dev/zero&nbsp;of=test.img&nbsp;bs=10k&nbsp;count=1&nbsp;oflag=direct"&nbsp;and
&gt;&gt;
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"dd&nbsp;if=/dev/zero&nbsp;of=test.img&nbsp;bs=10k&nbsp;count=1"
&gt;&gt;
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;These&nbsp;two&nbsp;commands&nbsp;should&nbsp;get&nbsp;the&nbsp;same&nbsp;write&nbsp;performance.
&gt;&gt;
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;While&nbsp;when&nbsp;I&nbsp;do&nbsp;this,&nbsp;the&nbsp;results&nbsp;of&nbsp;these&nbsp;two&nbsp;commands&nbsp;are&nbsp;not&nbsp;same
&gt;&gt;&nbsp;each&nbsp;other.&nbsp;and&nbsp;the&nbsp;gap&nbsp;is&nbsp;big.
&gt;&gt;
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;How&nbsp;to&nbsp;explain?
&gt;
&gt;My&nbsp;impression&nbsp;is&nbsp;that&nbsp;there&nbsp;are&nbsp;write&nbsp;caching&nbsp;features,
&gt;but&nbsp;Gluster&nbsp;tries&nbsp;hard&nbsp;to&nbsp;maintain&nbsp;coherency&nbsp;and&nbsp;correctness&nbsp;regarding&nbsp;writes.
&gt;For&nbsp;one&nbsp;type&nbsp;of&nbsp;cache,&nbsp;see&nbsp;the&nbsp;write-behind&nbsp;translator&nbsp;that&nbsp;is&nbsp;enabled
&gt;by&nbsp;default.
&gt;
&gt;AFAIK,&nbsp;the&nbsp;difference&nbsp;between&nbsp;the&nbsp;to&nbsp;dd&nbsp;invocations&nbsp;is&nbsp;that&nbsp;the&nbsp;first
&gt;one&nbsp;disables
&gt;all&nbsp;caches,&nbsp;while&nbsp;the&nbsp;last&nbsp;one&nbsp;doesn't&nbsp;even&nbsp;wait&nbsp;for&nbsp;the&nbsp;sync&nbsp;before&nbsp;finishing.
&gt;My&nbsp;understanding&nbsp;leads&nbsp;me&nbsp;to&nbsp;say&nbsp;that&nbsp;the&nbsp;first&nbsp;one&nbsp;can't&nbsp;use&nbsp;cache&nbsp;at&nbsp;all,
&gt;while&nbsp;the&nbsp;second&nbsp;one&nbsp;uses&nbsp;all&nbsp;the&nbsp;cache&nbsp;there&nbsp;is.
&gt;
&gt;Try&nbsp;to&nbsp;run&nbsp;the&nbsp;last&nbsp;one&nbsp;with&nbsp;"conv=fsync".
&gt;This&nbsp;will&nbsp;sync&nbsp;the&nbsp;file&nbsp;at&nbsp;the&nbsp;end&nbsp;of&nbsp;writing,&nbsp;ensuring&nbsp;that&nbsp;when&nbsp;dd
&gt;returns&nbsp;the&nbsp;data&nbsp;should&nbsp;be&nbsp;on&nbsp;disk.&nbsp;This&nbsp;will&nbsp;probably&nbsp;even&nbsp;out&nbsp;the
&gt;run&nbsp;time&nbsp;for&nbsp;the&nbsp;two&nbsp;invocations.
&gt;
&gt;
&gt;
&gt;--
&gt;Vennlig&nbsp;hilsen
&gt;Torbjørn&nbsp;Thorsen
&gt;Utvikler&nbsp;/&nbsp;driftstekniker
&gt;
&gt;Trollweb&nbsp;Solutions&nbsp;AS
&gt;-&nbsp;Professional&nbsp;Magento&nbsp;Partner
&gt;www.trollweb.no
&gt;
&gt;Telefon&nbsp;dagtid:&nbsp;+47&nbsp;51215300
&gt;Telefon&nbsp;kveld/helg:&nbsp;For&nbsp;kunder&nbsp;med&nbsp;Serviceavtale
&gt;
&gt;Besøksadresse:&nbsp;Luramyrveien&nbsp;40,&nbsp;4313&nbsp;Sandnes
&gt;Postadresse:&nbsp;Maurholen&nbsp;57,&nbsp;4316&nbsp;Sandnes
&gt;
&gt;Husk&nbsp;at&nbsp;alle&nbsp;våre&nbsp;standard-vilkår&nbsp;alltid&nbsp;er&nbsp;gjeldende
</pre></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>