<font size=2 face="sans-serif">Sorry for the late reply.</font>
<br>
<br><tt><font size=2>Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt;
写于 2016/01/25 17:48:06:<br>
<br>
&gt; From: Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt;</font></tt>
<br><tt><font size=2>&gt; To: li.ping288@zte.com.cn, </font></tt>
<br><tt><font size=2>&gt; Cc: li.yi79@zte.com.cn, zhou.shigang37@zte.com.cn,
<br>
&gt; Liu.Jianjun3@zte.com.cn, yang.bin18@zte.com.cn</font></tt>
<br><tt><font size=2>&gt; Date: 2016/01/25 17:48</font></tt>
<br><tt><font size=2>&gt; Subject: Re: 答复: Re: [Gluster-devel] Gluster
AFR volume write <br>
&gt; performance has been seriously affected by GLUSTERFS_WRITE_IS_APPEND<br>
&gt; in afr_writev</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; <br>
</font></tt>
<br><tt><font size=2>&gt; On 01/25/2016 03:09 PM, li.ping288@zte.com.cn
wrote:</font></tt>
<br><tt><font size=2>&gt; Hi Pranith, <br>
&gt; <br>
&gt; I'd be willing to have a chance to do my contribution to open-source.
<br>
&gt; It's my first time to deliver a patch for GlusterFS, hence I'm not
<br>
&gt; quite familiar with the code review and submitting procedures. <br>
&gt; <br>
&gt; I'll try to make it ASAP. By the way is there any guidelines to do
this work?</font></tt>
<br><tt><font size=2>&gt; </font></tt><a href=http://www.gluster.org/community/documentation/index.php/><tt><font size=2>http://www.gluster.org/community/documentation/index.php/</font></tt></a><tt><font size=2><br>
&gt; Simplified_dev_workflow may be helpful. Feel free to ask any doubt
<br>
&gt; you may have.<br>
&gt; <br>
&gt; How do you guys use glusterfs?<br>
&gt; <br>
&gt; Pranith<br>
</font></tt>
<br><tt><font size=2>Thanks for your warm tips. &nbsp;We currently use
glusterfs to build the shared storage for distributed cluster nodes.</font></tt>
<br>
<br><tt><font size=2>Here are the solutions I pondered over these days:</font></tt>
<br>
<br><tt><font size=2>1,Reverting the AFR GLUSTERFS_WRITE_IS_APPEND modifications.
&nbsp;because this optimization only play a part for appending write fops,
</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp;but most of the time of writing
it is not kind of this. Hence I think it is not worth to do an optimization
for the low probability situation &nbsp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp;at cost of the vast majority of
AFR writing performance drop. </font></tt>
<br><tt><font size=2>2,Revising the fixed GLUSTERFS_WRITE_IS_APPEND dictionary
option in afr_writev in a dynamic way. &nbsp;i.e. adding a new dynamic
configurable</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp;option &quot;write_is_append&quot;
just as the existing &quot;ensure-durability&quot; for AFR. &nbsp;It could
be configured on if AFR writing performance is not mainly </font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp;concerned and off if the performance
is demanded.</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp;</font></tt>
<br><tt><font size=2>I have been trying to find out a way in posix_writev
to predict the appending write &nbsp;in advance and then lock/unlock or
not lock accordingly in the </font></tt>
<br><tt><font size=2>shortest and soonest, but I get no chance.</font></tt>
<br>
<br><tt><font size=2>Anybody's other good ideas are appreciated.</font></tt>
<br>
<br><tt><font size=2>Ping.Li</font></tt>
<br>
<br><tt><font size=2>&gt; <br>
&gt; Thanks &amp; Best Regards. <br>
&gt; <br>
&gt; Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt; 写于 2016/01/23
14:01:36:<br>
&gt; <br>
&gt; &gt; From: Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt; <br>
&gt; &gt; To: li.ping288@zte.com.cn, gluster-devel@gluster.org, <br>
&gt; &gt; Cc: li.yi79@zte.com.cn, Liu.Jianjun3@zte.com.cn, <br>
&gt; &gt; zhou.shigang37@zte.com.cn, yang.bin18@zte.com.cn <br>
&gt; &gt; Date: 2016/01/23 14:02 <br>
&gt; &gt; Subject: Re: 答复: Re: [Gluster-devel] Gluster AFR volume write
<br>
&gt; &gt; performance has been seriously affected by GLUSTERFS_WRITE_IS_APPEND<br>
&gt; &gt; in afr_writev <br>
&gt; &gt; <br>
&gt; &gt; <br>
&gt; <br>
&gt; &gt; On 01/22/2016 07:14 AM, li.ping288@zte.com.cn wrote: <br>
&gt; &gt; Hi Pranith, it is appreciated for your reply. <br>
&gt; &gt; <br>
&gt; &gt; Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt; 写于 2016/01/20
18:51:19:<br>
&gt; &gt; <br>
&gt; &gt; &gt; 发件人: &nbsp;Pranith Kumar Karampuri &lt;pkarampu@redhat.com&gt;
<br>
&gt; &gt; &gt; 收件人: &nbsp;li.ping288@zte.com.cn, gluster-devel@gluster.org,
<br>
&gt; &gt; &gt; 日期: &nbsp;2016/01/20 18:51 <br>
&gt; &gt; &gt; 主题: Re: [Gluster-devel] Gluster AFR volume write performance
has <br>
&gt; &gt; &gt; been seriously affected by GLUSTERFS_WRITE_IS_APPEND in
afr_writev <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; Sorry for the delay in response.<br>
&gt; &gt; <br>
&gt; &gt; &gt; On 01/15/2016 02:34 PM, li.ping288@zte.com.cn wrote: <br>
&gt; &gt; &gt; GLUSTERFS_WRITE_IS_APPEND Setting in afr_writev function
at <br>
&gt; &gt; &gt; glusterfs client end makes the posix_writev in the server
end &nbsp;deal <br>
&gt; &gt; &gt; IO write fops from parallel &nbsp;to serial in consequence.
<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; i.e. &nbsp;multiple io-worker threads carrying out IO write
fops are <br>
&gt; &gt; &gt; blocked in posix_writev to execute final write fop pwrite/pwritev
in<br>
&gt; &gt; &gt; __posix_writev function ONE AFTER ANOTHER. <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; For example: <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; thread1: iot_worker -&gt; ... &nbsp;-&gt; posix_writev()
&nbsp; | <br>
&gt; &gt; &gt; thread2: iot_worker -&gt; ... &nbsp;-&gt; posix_writev()
&nbsp; | <br>
&gt; &gt; &gt; thread3: iot_worker -&gt; ... &nbsp;-&gt; posix_writev()
&nbsp; -&gt; __posix_writev() <br>
&gt; &gt; &gt; thread4: iot_worker -&gt; ... &nbsp;-&gt; posix_writev()
&nbsp; | <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; there are 4 iot_worker thread doing the 128KB IO write fops
as <br>
&gt; &gt; &gt; above, but only one can execute __posix_writev function
and the <br>
&gt; &gt; &gt; others have to wait. <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; however, if the afr volume is configured on with storage.linux-aio
<br>
&gt; &gt; &gt; which is off in default, &nbsp;the iot_worker will use posix_aio_writev
<br>
&gt; &gt; &gt; instead of posix_writev to write data. <br>
&gt; &gt; &gt; the posix_aio_writev function won't be affected by <br>
&gt; &gt; &gt; GLUSTERFS_WRITE_IS_APPEND, and the AFR volume write performance
goes up. <br>
&gt; &gt; &gt; I think this is a bug :-(. <br>
&gt; &gt; <br>
&gt; &gt; Yeah, I agree with you. I suppose the GLUSTERFS_WRITE_IS_APPEND
is a<br>
&gt; &gt; misuse in afr_writev. <br>
&gt; &gt; I checked the original intent of GLUSTERS_WRITE_IS_APPEND change
at <br>
&gt; &gt; review website: <br>
&gt; &gt; </font></tt><a href=http://review.gluster.org/#/c/5501/><tt><font size=2>http://review.gluster.org/#/c/5501/</font></tt></a><tt><font size=2>
<br>
&gt; &gt; <br>
&gt; &gt; The initial purpose seems to avoid an unnecessary fsync() in
<br>
&gt; &gt; afr_changelog_post_op_safe function if the writing data position
<br>
&gt; &gt; was currently at the end of the file, detected by <br>
&gt; &gt; (preop.ia_size == offset || (fd-&gt;flags &amp; O_APPEND)) in
posix_writev. <br>
&gt; &gt; <br>
&gt; &gt; In comparison with the afr write performance loss, I think <br>
&gt; &gt; it costs too much. <br>
&gt; &gt; <br>
&gt; &gt; I suggest to make the GLUSTERS_WRITE_IS_APPEND setting configurable
<br>
&gt; &gt; just as ensure-durability in afr. <br>
&gt; &gt; <br>
&gt; &gt; You are right, it doesn't make sense to put this option in <br>
&gt; &gt; dictionary if ensure-durability is off. </font></tt><a href=http://review.gluster.org/13285><tt><font size=2>http://review.gluster.org/13285</font></tt></a><tt><font size=2><br>
&gt; &gt; addresses this. Do you want to try this out?<br>
&gt; &gt; Thanks for doing most of the work :-). Do let me know if you
want to<br>
&gt; &gt; raise a bug for this. Or I can take that up if you don't have
time.<br>
&gt; &gt; <br>
&gt; &gt; Pranith <br>
&gt; &gt; <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; So, my question is whether &nbsp;AFR volume could work fine
with <br>
&gt; &gt; &gt; storage.linux-aio configuration which bypass the <br>
&gt; &gt; &gt; GLUSTERFS_WRITE_IS_APPEND setting in afr_writev, <br>
&gt; &gt; &gt; and why glusterfs keeps posix_aio_writev different from
posix_writev ? <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; Any replies to clear my confusion would be grateful, and
thanks <br>
&gt; in advance.<br>
&gt; &gt; &gt; What is the workload you have? multiple writers on same
file workloads? <br>
&gt; &gt; <br>
&gt; &gt; I test the afr gluster volume by fio like this: <br>
&gt; &gt; fio --filename=/mnt/afr/20G.dat --direct=1 --rw=write --bs=128k
--<br>
&gt; &gt; size=20G --numjobs=8 &nbsp; <br>
&gt; &gt; --runtime=60 --group_reporting --name=afr_test &nbsp;--iodepth=1
--<br>
&gt; ioengine=libaio<br>
&gt; &gt; <br>
&gt; &gt; The Glusterfs BRICKS are two IBM X3550 M3. <br>
&gt; &gt; <br>
&gt; &gt; The local disk direct write performance of 128KB IO req block
size <br>
&gt; &gt; is about 18MB/s <br>
&gt; &gt; in single thread and 80MB/s in 8 multi-threads. <br>
&gt; &gt; <br>
&gt; &gt; If the GLUSTERS_WRITE_IS_APPEND is configed, the afr gluster
volume <br>
&gt; &gt; write performance is 18MB/s <br>
&gt; &gt; as the single thread, and if not, the performance is nearby 75MB/s.<br>
&gt; &gt; (network bandwith is enough) <br>
&gt; &gt; <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; Pranith <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; --------------------------------------------------------<br>
&gt; &gt; &gt; ZTE Information Security Notice: The information contained
in this <br>
&gt; &gt; &gt; mail (and any attachment transmitted herewith) is privileged
and <br>
&gt; &gt; &gt; confidential and is intended for the exclusive use of the
addressee<br>
&gt; &gt; &gt; (s). &nbsp;If you are not an intended recipient, any disclosure,
<br>
&gt; &gt; &gt; reproduction, distribution or other dissemination or use
of the <br>
&gt; &gt; &gt; information contained is strictly prohibited. &nbsp;If you
have received <br>
&gt; &gt; &gt; this mail in error, please delete it and notify us immediately.<br>
&gt; &gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; Gluster-devel mailing list<br>
&gt; &gt; &gt; Gluster-devel@gluster.org<br>
&gt; &gt; &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><tt><font size=2>
<br>
&gt; &gt; <br>
&gt; &gt; --------------------------------------------------------<br>
&gt; &gt; ZTE Information Security Notice: The information contained in
this <br>
&gt; &gt; mail (and any attachment transmitted herewith) is privileged
and <br>
&gt; &gt; confidential and is intended for the exclusive use of the addressee<br>
&gt; &gt; (s). &nbsp;If you are not an intended recipient, any disclosure,
<br>
&gt; &gt; reproduction, distribution or other dissemination or use of the
<br>
&gt; &gt; information contained is strictly prohibited. &nbsp;If you have
received <br>
&gt; &gt; this mail in error, please delete it and notify us immediately.<br>
&gt; &gt; </font></tt>