<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 01/22/2016 07:14 AM,
      <a class="moz-txt-link-abbreviated" href="mailto:li.ping288@zte.com.cn">li.ping288@zte.com.cn</a> wrote:<br>
    </div>
    <blockquote
cite="mid:OF4E0D94AB.CD1AFBEA-ON48257F42.00077073-48257F42.00099089@zte.com.cn"
      type="cite"><font face="sans-serif" size="2">Hi </font><tt><font
          size="2">Pranith</font></tt><font face="sans-serif" size="2">,
        it is appreciated for your reply.</font>
      <br>
      <br>
      <tt><font size="2">Pranith Kumar Karampuri
          <a class="moz-txt-link-rfc2396E" href="mailto:pkarampu@redhat.com">&lt;pkarampu@redhat.com&gt;</a>
          写于 2016/01/20 18:51:19:<br>
          <br>
          &gt; 发件人:  Pranith Kumar Karampuri <a class="moz-txt-link-rfc2396E" href="mailto:pkarampu@redhat.com">&lt;pkarampu@redhat.com&gt;</a></font></tt>
      <br>
      <tt><font size="2">&gt; 收件人:  <a class="moz-txt-link-abbreviated" href="mailto:li.ping288@zte.com.cn">li.ping288@zte.com.cn</a>,
          <a class="moz-txt-link-abbreviated" href="mailto:gluster-devel@gluster.org">gluster-devel@gluster.org</a>,
        </font></tt>
      <br>
      <tt><font size="2">&gt; 日期:  2016/01/20 18:51</font></tt>
      <br>
      <tt><font size="2">&gt; 主题: Re: [Gluster-devel] Gluster AFR volume
          write performance has <br>
          &gt; been seriously affected by GLUSTERFS_WRITE_IS_APPEND in
          afr_writev</font></tt>
      <br>
      <tt><font size="2">&gt; <br>
          &gt; Sorry for the delay in response.<br>
        </font></tt>
      <br>
      <tt><font size="2">&gt; On 01/15/2016 02:34 PM,
          <a class="moz-txt-link-abbreviated" href="mailto:li.ping288@zte.com.cn">li.ping288@zte.com.cn</a>
          wrote:</font></tt>
      <br>
      <tt><font size="2">&gt; GLUSTERFS_WRITE_IS_APPEND Setting in
          afr_writev
          function at <br>
          &gt; glusterfs client end makes the posix_writev in the server
          end  deal
          <br>
          &gt; IO write fops from parallel  to serial in consequence. <br>
          &gt; <br>
          &gt; i.e.  multiple io-worker threads carrying out IO write
          fops are
          <br>
          &gt; blocked in posix_writev to execute final write fop
          pwrite/pwritev
          in<br>
          &gt; __posix_writev function ONE AFTER ANOTHER. <br>
          &gt; <br>
          &gt; For example: <br>
          &gt; <br>
          &gt; thread1: iot_worker -&gt; ...  -&gt; posix_writev()   |
          <br>
          &gt; thread2: iot_worker -&gt; ...  -&gt; posix_writev()   |
          <br>
          &gt; thread3: iot_worker -&gt; ...  -&gt; posix_writev()  
          -&gt;
          __posix_writev() <br>
          &gt; thread4: iot_worker -&gt; ...  -&gt; posix_writev()   |
          <br>
          &gt; <br>
          &gt; there are 4 iot_worker thread doing the 128KB IO write
          fops as <br>
          &gt; above, but only one can execute __posix_writev function
          and the <br>
          &gt; others have to wait. <br>
          &gt; <br>
          &gt; however, if the afr volume is configured on with
          storage.linux-aio
          <br>
          &gt; which is off in default,  the iot_worker will use
          posix_aio_writev
          <br>
          &gt; instead of posix_writev to write data. <br>
          &gt; the posix_aio_writev function won't be affected by <br>
          &gt; GLUSTERFS_WRITE_IS_APPEND, and the AFR volume write
          performance goes
          up. </font></tt>
      <br>
      <tt><font size="2">&gt; I think this is a bug :-(.</font></tt>
      <br>
      <br>
      <tt><font size="2">Yeah, I agree with you. I suppose the
          GLUSTERFS_WRITE_IS_APPEND
          is a misuse in afr_writev.</font></tt>
      <br>
      <tt><font size="2">I checked the original intent of
          GLUSTERS_WRITE_IS_APPEND
          change at review website:</font></tt>
      <br>
      <a moz-do-not-send="true"
        href="http://review.gluster.org/#/c/5501/"><font color="blue"
          size="3"><u>http://review.gluster.org/#/c/5501/</u></font></a><font
        size="3">
      </font>
      <br>
      <br>
      <tt><font size="2">The initial purpose seems to avoid an
          unnecessary
        </font></tt><tt><font color="#2f2f2f" size="2">fsync()</font></tt><font
        size="3">
      </font><tt><font size="2">in </font></tt>
      <br>
      <tt><font size="2">afr_changelog_post_op_safe function if the
          writing
          data position </font></tt>
      <br>
      <tt><font size="2">was currently at the end of the file, detected
          by
        </font></tt>
      <br>
      <tt><font size="2">(preop.ia_size == offset || (fd-&gt;flags &amp;
          O_APPEND))
          in posix_writev.</font></tt>
      <br>
      <br>
      <tt><font size="2">In </font></tt><tt><font size="2">comparison
          with the
          afr write performance loss, I think </font></tt>
      <br>
      <tt><font size="2">it costs too much. </font></tt>
      <br>
      <br>
      <tt><font size="2">I suggest to make the </font></tt><tt><font
          size="2">GLUSTERS_WRITE_IS_APPEND
        </font></tt><tt><font size="2">setting configurable</font></tt>
      <br>
      <tt><font size="2">just as ensure-durability in afr.</font></tt>
      <br>
    </blockquote>
    <br>
    You are right, it doesn't make sense to put this option in
    dictionary if ensure-durability is off.
    <a class="moz-txt-link-freetext" href="http://review.gluster.org/13285">http://review.gluster.org/13285</a> addresses this. Do you want to try
    this out?<br>
    Thanks for doing most of the work :-). Do let me know if you want to
    raise a bug for this. Or I can take that up if you don't have time.<br>
    <br>
    Pranith<br>
    <blockquote
cite="mid:OF4E0D94AB.CD1AFBEA-ON48257F42.00077073-48257F42.00099089@zte.com.cn"
      type="cite">
      <br>
      <tt><font size="2">&gt; <br>
          &gt; So, my question is whether  AFR volume could work fine
          with <br>
          &gt; storage.linux-aio configuration which bypass the <br>
          &gt; GLUSTERFS_WRITE_IS_APPEND setting in afr_writev, <br>
          &gt; and why glusterfs keeps posix_aio_writev different from
          posix_writev
          ? <br>
          &gt; <br>
          &gt; Any replies to clear my confusion would be grateful, and
          thanks in
          advance.</font></tt>
      <br>
      <tt><font size="2">&gt; What is the workload you have? multiple
          writers
          on same file workloads?</font></tt>
      <br>
      <br>
      <tt><font size="2">I test the afr gluster volume by fio like this:</font></tt>
      <br>
      <tt><font size="2">fio --filename=/mnt/afr/20G.dat --direct=1
          --rw=write
          --bs=128k --size=20G --numjobs=8  </font></tt>
      <br>
      <tt><font size="2">--runtime=60 --group_reporting --name=afr_test
           --iodepth=1
          --ioengine=libaio</font></tt>
      <br>
      <br>
      <tt><font size="2">The Glusterfs BRICKS are two IBM X3550 M3. </font></tt>
      <br>
      <br>
      <tt><font size="2">The local disk direct write performance of
          128KB IO
          req block size is about 18MB/s </font></tt>
      <br>
      <tt><font size="2">in single thread and 80MB/s in 8 multi-threads.</font></tt>
      <br>
      <br>
      <tt><font size="2">If the GLUSTERS_WRITE_IS_APPEND is configed,
          the afr
          gluster volume write performance is 18MB/s</font></tt>
      <br>
      <tt><font size="2">as the single thread, and if not, the
          performance
          is nearby 75MB/s.(network bandwith is enough)</font></tt>
      <br>
      <tt><font size="2"><br>
          &gt; <br>
          &gt; Pranith</font></tt>
      <br>
      <tt><font size="2">&gt; <br>
          &gt; <br>
          &gt; --------------------------------------------------------<br>
          &gt; ZTE Information Security Notice: The information
          contained in this
          <br>
          &gt; mail (and any attachment transmitted herewith) is
          privileged and <br>
          &gt; confidential and is intended for the exclusive use of the
          addressee<br>
          &gt; (s).  If you are not an intended recipient, any
          disclosure, <br>
          &gt; reproduction, distribution or other dissemination or use
          of the <br>
          &gt; information contained is strictly prohibited.  If you
          have received
          <br>
          &gt; this mail in error, please delete it and notify us
          immediately.<br>
          &gt; <br>
        </font></tt>
      <br>
      <tt><font size="2">&gt; <br>
          &gt; <br>
        </font></tt>
      <br>
      <tt><font size="2">&gt;
          _______________________________________________<br>
          &gt; Gluster-devel mailing list<br>
          &gt; <a class="moz-txt-link-abbreviated" href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
          &gt; </font></tt><a moz-do-not-send="true"
        href="http://www.gluster.org/mailman/listinfo/gluster-devel"><tt><font
            size="2">http://www.gluster.org/mailman/listinfo/gluster-devel</font></tt></a>
      <br>
      <pre><font color="blue">
--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s).  If you are not an intended recipient, any disclosure, reproduction, distribution or other dissemination or use of the information contained is strictly prohibited.  If you have received this mail in error, please delete it and notify us immediately.

</font></pre>
      <br>
    </blockquote>
    <br>
  </body>
</html>