<font size=2 face="sans-serif">Hi </font><tt><font size=2>Pranith</font></tt><font size=2 face="sans-serif">,
it is appreciated for your reply.</font>
<br>
<br><tt><font size=2>Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt;
写于 2016/01/20 18:51:19:<br>
<br>
&gt; 发件人: &nbsp;Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt;</font></tt>
<br><tt><font size=2>&gt; 收件人: &nbsp;li.ping288@zte.com.cn, gluster-devel@gluster.org,
</font></tt>
<br><tt><font size=2>&gt; 日期: &nbsp;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, li.ping288@zte.com.cn
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 &nbsp;deal
<br>
&gt; IO write fops from parallel &nbsp;to serial in consequence. <br>
&gt; <br>
&gt; i.e. &nbsp;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; ... &nbsp;-&gt; posix_writev() &nbsp; |
<br>
&gt; thread2: iot_worker -&gt; ... &nbsp;-&gt; posix_writev() &nbsp; |
<br>
&gt; thread3: iot_worker -&gt; ... &nbsp;-&gt; posix_writev() &nbsp; -&gt;
__posix_writev() <br>
&gt; thread4: iot_worker -&gt; ... &nbsp;-&gt; posix_writev() &nbsp; |
<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, &nbsp;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 href=http://review.gluster.org/#/c/5501/><font size=3 color=blue><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 size=2 color=#2f2f2f>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>
<br><tt><font size=2>&gt; <br>
&gt; So, my question is whether &nbsp;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 &nbsp;</font></tt>
<br><tt><font size=2>--runtime=60 --group_reporting --name=afr_test &nbsp;--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). &nbsp;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. &nbsp;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; Gluster-devel@gluster.org<br>
&gt; </font></tt><a 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>