<div><br></div><div><div>&nbsp;</div><table cellspacing="0" cellpadding="0" border="0" style="font-size:12px;"><tbody><tr><td ui-type="shareCon"><div ui-type="shareField" style="padding-bottom:10px;background:#f2f2f2;border-radius:5px;"><div unselectable="on" style="margin-bottom:8px;padding:8px;color:#a0a0a0;border-bottom:1px solid #ccc;-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;"><img src="//mail.qq.com/zh_CN/htmledition/images/icon_weiyun.png" width="16" height="16" style=" vertical-align:middle;margin:-2px 4px 0 0; ; " notforedit="1">微云的文件</div><a ui-type="shareLink" id="L3JlY2VudC9wZXJmLmRhdGEuZ2x1c3RlcmZzZC5zZWxmLWhlYWwuaGVhdnkuZmlsZXMuc3Zn__759bc0c9_5908_4d7a_b9b6_bc40677a4567" class="netdisk_fileitem" style="display: block; padding: 8px 10px 7px;" notforedit="1" target="_blank" href="http://share.weiyun.com/91b89f266cb47414d084db0f7a46ff7f"><table cellspacing="0" cellpadding="0" border="0" unselectable="on" style="table-layout:fixed;font-size:12px;-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;"><tbody><tr style="line-height:14px;"><td width="16" align="left" valign="top"><img src="https://mail.qq.com/zh_CN/htmledition/images/xdisk/ico_mid/fu_blank.gif" width="16" height="16" notforedit="1" style="vertical-align: top;"></td><td width="380" align="left" valign="top"><span style="padding-left:5px;display:inline-block;word-wrap:normal;width:380px;" title="perf.data.glusterfsd.self-heal.heavy.files.svg"><span style="display: inline-block; max-width: 300px; white-space: nowrap;">perf.data.glusterfsd.self-heal.he...</span><span style="margin-left:3px;color:#a0a0a0;">(2.05M)</span></span></td><td ui-type="iconSucc" width="50" align="right" valign="top"><img ui-type="goIcon" src="https://mail.qq.com/zh_CN/htmledition/images/spacer.gif" width="14" height="14" notforedit="1" style="background: url(&quot;https://mail.qq.com/zh_CN/htmledition/images/netdisk/netdisk_arrow.png&quot;) no-repeat;"><img ui-type="delIcon" title="移除此文件" style="cursor: pointer; display: none; visibility: hidden; background: url(&quot;https://mail.qq.com/zh_CN/htmledition/images/netdisk/netdisk_del.png&quot;) no-repeat;" src="https://mail.qq.com/zh_CN/htmledition/images/spacer.gif" width="0" height="0" notforedit="1"></td></tr></tbody></table></a></div></td></tr></tbody></table><div><br></div><div>the attachments &nbsp;is the result of perf when cpu load is &nbsp;500%~800%, it shows "get xattr &nbsp;operation " &nbsp;cost &nbsp;most &nbsp;cpu time.</div><div><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b>&nbsp;"Russell Purinton";&lt;russell.purinton@gmail.com&gt;;</div><div><b>发送时间:</b>&nbsp;2016年3月23日(星期三) 下午4:06</div><div><b>收件人:</b>&nbsp;"Norbert"&lt;norbert.huang@qq.com&gt;; <wbr></div><div><b>抄送:</b>&nbsp;"gluster-users"&lt;gluster-users@gluster.org&gt;; <wbr></div><div><b>主题:</b>&nbsp;Re: [Gluster-users] a workaround for hight cpu load</div></div><div><br></div>I’m only about 90% sure about this, but I think the Self Heal Daemon is a glusterfs process that must communicate with glusterfsd for healing to take place.  blocking communications like this is basically breaking the Self Heal Daemon and your files are probably not being healed correctly.<br>
<br>
Healing requires high CPU due to the default “diff” algorithm which will actually read the files and send only the differences over the network.   You can trade CPU impact for Network Bandwidth by using the ‘full’ algorithm, then it doesn’t need to compute info on the files themselves. <br>
<br>
Can anyone confirm if I’m correct about this?<br>
<br>
<br>
On Mar 22, 2016, at 11:05 PM, Norbert &lt;norbert.huang@qq.com&gt; wrote:<br>
<br>
<br>
problem:  when self-heal  is running with  many files, it  make cpu high load and  gluster client cannot write new file and  read file.<br>
<br>
as described at: http://www.gluster.org/pipermail/gluster-users/2015-November/024228.html<br>
<br>
from following tests, I realize that: when  close  tcp  connections between glusterfs and  glusterfsd  in gluster server,it  can reduce  cpu load and not affect  gluster  client to write and read file.<br>
<br>
<br>
<br>
<br>
=========================  config begin ==================================<br>
gluster  3.5.1<br>
<br>
#gluster volume status<br>
Status of volume: tr5<br>
Gluster process                                         Port    Online  Pid<br>
------------------------------------------------------------------------------<br>
Brick 192.168.5.252:/home/gluster351/r15                49157   Y       11899<br>
Brick 192.168.5.76:/home/gluster/r15             49152   Y       26692<br>
NFS Server on localhost                                 N/A     N       N/A<br>
Self-heal Daemon on localhost                           N/A     Y       11918<br>
NFS Server on 192.168.5.76                              N/A     N       N/A<br>
Self-heal Daemon on 192.168.5.76                        N/A     Y       26705<br>
 <br>
Task Status of Volume tr5<br>
------------------------------------------------------------------------------<br>
There are no active volume tasks<br>
<br>
<br>
gluster client:   192.168.16.207:1019<br>
# mount<br>
192.168.5.252:/tr5 on /home/mariadb/data/tr5 type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072)<br>
<br>
=========================  config end ==================================<br>
<br>
<br>
========================= test 1  begin =================================<br>
at 192.168.5.252,run:<br>
iptables -A INPUT -p tcp --dport 49157  -j DROP  -s  192.168.5.252<br>
iptables -A INPUT -p tcp --dport 49157  -j DROP  -s  192.168.5.76<br>
<br>
at 192.168.5.76,run:<br>
iptables -A INPUT -p tcp --dport 49152  -j DROP  -s   192.168.5.252<br>
iptables -A INPUT -p tcp --dport 49152  -j DROP  -s   192.168.5.76<br>
<br>
gluster client can write and read files as normal.<br>
========================= test 1  end ==================================<br>
<br>
<br>
========================= test 2  begin ==================================<br>
1:  at 192.168.5.76, shutdown process: glusterd, glusterfsd, glusterfs.<br>
2:  at gluster client, copy  10k files to gluster server.  <br>
3:  at 192.168.5.252,  there are  10k+ link file under  directory /home/gluster351/r15/.glusterfs/indices/xattrop.<br>
4:  at 192.168.5.76, start  gluster service.  then self-heal  begins.<br>
5:  during self-heal, at 192.168.5.252 , glusterfs %CPU 5.7 , glusterfsd    %CPU 7.0<br>
<br>
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                          <br>
 11918 root      20   0  321m  36m 2816 S  7.0  0.5   1:28.07 glusterfs                                                                                                                                        <br>
  11899 root      20   0  824m  42m 3164 S  5.7  0.5  20:43.39 glusterfsd      <br>
<br>
6:  during self-heal, at 192.168.5.76 , glusterfs %CPU 0 , glusterfsd    %CPU 6.0<br>
7:  during self-heal, at 192.168.5.76 , run:<br>
      iptables -A INPUT -p tcp --dport 49152  -j DROP  -s   192.168.5.252<br>
      iptables -A INPUT -p tcp --dport 49152  -j DROP  -s   192.168.5.76<br>
     <br>
     after run iptables, at 192.168.5.76  and 192.168.5.252, both glusterfs %CPU 0 , glusterfsd    %CPU 0<br>
8:   at 192.168.5.252,  there are  7000+ link file under  directory /home/gluster351/r15/.glusterfs/indices/xattrop.<br>
9:   gluster client can write and read files as normal.<br>
========================= test 2  begin ==================================<br>
<br>
_______________________________________________<br>
Gluster-users mailing list<br>
Gluster-users@gluster.org<br>
http://www.gluster.org/mailman/listinfo/gluster-users<br>
<br>

<img src="http://t.sidekickopen04.com/e1t/o/5/f18dQhb0S7ks8dDMPbW2n0x6l2B9gXrN7sKj6v4LN9-W2z8_hM5wLWr-N7dSKlbd3_yKW6jq8hk1k1H6H0?si=6102096971038720&amp;pi=7F5B7BF4-5554-4D36-B9D0-2F12A2C77FEE" width="1" height="1" style="display:none!important"></div></div>