<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:51:12 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-5405] Performance issue while using robinhood in changelog mode </title>
                <link>https://jira.whamcloud.com/browse/LU-5405</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;We are facing a performance issue when using robinhood in changelog mode on top&lt;br/&gt;
of Lustre 2.4.3.&lt;/p&gt;

&lt;p&gt;The more the changelog size increase, the more time to clear the records increase.&lt;/p&gt;

&lt;p&gt;The production has started on 2014/06/19, after a update from Lustre 2.1 to&lt;br/&gt;
Lustre 2.4. The robinhood service has been started on 2014/06/24 09:07:16.&lt;/p&gt;

&lt;p&gt;The evolution of the read speed is shown in figure robinhood-readspeed.png. The&lt;br/&gt;
read speed is the number of record processed per second by robinhood, kept in&lt;br/&gt;
its logfile. (see attached file robinhood.log.STATS)&lt;/p&gt;

&lt;p&gt;The performance of the changelog clear is also available in this logfile. This&lt;br/&gt;
performance is mesured in ms per operation. The evolution of the changelog&lt;br/&gt;
clear performance is shown in figure robinhood-changelogclear.png.&lt;/p&gt;

&lt;p&gt;The service has been restarted on 2014/07/16 11:11:50, with no improvments.&lt;/p&gt;

&lt;p&gt;As the customer was suspecting the performance of the mysql backend storage to&lt;br/&gt;
be the root cause of this issue, the Lustre client running robinhood has been&lt;br/&gt;
moved from a bullx S6030 (32 sockets, 64GB memory) to a bullx S6030 (32&lt;br/&gt;
sockets, 128GB memory) connected to a faster backend storage for storing the&lt;br/&gt;
mysql db on 2014/07/17. The service has been restarted on 2014/07/18 09:41:54&lt;br/&gt;
and several times since, until the reboot of the Lustre client on 2014/07/21&lt;br/&gt;
12:00:00. We then hit a lot of evictions due to ldlm callbacks timeout. We&lt;br/&gt;
stopped the robinhood service on 2014/07/22 10:14:14.&lt;/p&gt;

&lt;p&gt;By looking at the changelog, we observed that the MDS was still clearing&lt;br/&gt;
records. It cleared records until 2014/07/22 20:00:00.&lt;/p&gt;

&lt;p&gt;The MDS was clearing records with a rate of 30 records/sec.&lt;/p&gt;

&lt;p&gt;In the meantime, by looking at the MDS, I find out that the kernel thread&lt;br/&gt;
&lt;tt&gt;mdt03_068&lt;/tt&gt; (PID 20076) is in charge of the changelog clear. This thread is&lt;br/&gt;
running on CPU 27.&lt;/p&gt;

&lt;p&gt;The function llog_cat_id2handle() makes an heavy use of this CPU:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Samples: 27K of event &lt;span class=&quot;code-quote&quot;&gt;&apos;cycles&apos;&lt;/span&gt;, Event count (approx.): 2347474354
 46.45% [obdclass] [k] llog_cat_id2handle
 37.66% [kernel] [k] _spin_lock_irqsave
  4.34% [kernel] [k] _spin_lock
  0.71% [kernel] [k] find_busiest_group
  0.32% [kernel] [k] _spin_unlock_irqrestore
  0.26% [ldiskfs] [k] 0x0000000000043778
  0.24% [lvfs] [k] lprocfs_counter_add
  0.16% [kernel] [k] schedule
  0.16% [mlx4_ib] [k] 0x0000000000000c34
  0.15% [kernel] [k] thread_return
  0.14% [kernel] [k] apic_timer_interrupt
  0.14% [obdclass] [k] class_handle2object
  0.12% [ko2iblnd] [k] kiblnd_find_peer_locked
  0.12% [kernel] [k] menu_select
  0.11% [kernel] [k] _spin_lock_irq
  0.11% [ko2iblnd] [k] kiblnd_scheduler
  0.11% [kernel] [k] find_next_bit
  0.10% [kernel] [k] fair_update_curr
  0.10% [kernel] [k] memcpy
  0.09% [kernel] [k] kfree
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In the context of clearing records, the function seems to be called by&lt;br/&gt;
&lt;tt&gt;llog_cat_cancel_records()&lt;/tt&gt;. I enabled the rpctrace debug on the mds. A sample of&lt;br/&gt;
the debug log is available in file debug.rpctrace.pid20076.&lt;/p&gt;

&lt;p&gt;We still see the same rate of 30 rec/sec.&lt;/p&gt;

&lt;p&gt;The bottleneck seems to be in this portion of code (lustre/obdclass/llog_cat.c):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;155 &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; llog_cat_id2handle(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct lu_env *env, struct llog_handle *cathandle,
156                struct llog_handle **res, struct llog_logid *logid)
157 {
158     struct llog_handle  *loghandle;
...
166     down_write(&amp;amp;cathandle-&amp;gt;lgh_lock);
167     cfs_list_for_each_entry(loghandle, &amp;amp;cathandle-&amp;gt;u.chd.chd_head,      &amp;lt;== bottleneck ?
168                 u.phd.phd_entry) {
169         struct llog_logid *cgl = &amp;amp;loghandle-&amp;gt;lgh_id;
170
171         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (ostid_id(&amp;amp;cgl-&amp;gt;lgl_oi) == ostid_id(&amp;amp;logid-&amp;gt;lgl_oi) &amp;amp;&amp;amp;       ==&amp;gt; ostid_id:  &lt;span class=&quot;code-comment&quot;&gt;/* extract OST objid from a wire ost_id (id/seq) pair */&lt;/span&gt;
172             ostid_seq(&amp;amp;cgl-&amp;gt;lgl_oi) == ostid_seq(&amp;amp;logid-&amp;gt;lgl_oi)) {     ==&amp;gt; ostid_seq: &lt;span class=&quot;code-comment&quot;&gt;/* extract OST sequence (group) from a wire ost_id (id/seq) pair */&lt;/span&gt;
                                                                            ==&amp;gt; check &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; it is the same log object (id/seq)
173             &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (cgl-&amp;gt;lgl_ogen != logid-&amp;gt;lgl_ogen) {
...
179             }
180             loghandle-&amp;gt;u.phd.phd_cat_handle = cathandle;
181             up_write(&amp;amp;cathandle-&amp;gt;lgh_lock);
182             GOTO(out, rc = 0);
...
212 out:
213     llog_handle_get(loghandle);
214     *res = loghandle;
215     &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; 0;
216 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, the robinhood has been restarted on 2014/07/22 16:46:19, but in scan&lt;br/&gt;
mode.&lt;/p&gt;

&lt;p&gt;The changelog has not been deregistered yet, we are keeping it for testing&lt;br/&gt;
purposes. We plan to register a new changelog in order to restart robinhood in&lt;br/&gt;
changelog mode and see if we observe the same behavior.&lt;/p&gt;</description>
                <environment>Kernel: kernel-2.6.32-431.11.2.el6.x86_64 w/ patch for Lustre&lt;br/&gt;
Lustre: lustre-2.4.3-Bull.4.014.el6.20140426.x86_64&lt;br/&gt;
Filesystem: 150,000,000+ inodes, 5000+ clients&lt;br/&gt;
Robinhood: 2.5</environment>
        <key id="25724">LU-5405</key>
            <summary>Performance issue while using robinhood in changelog mode </summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="bfaccini">Bruno Faccini</assignee>
                                    <reporter username="bruno.travouillon">Bruno Travouillon</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Jul 2014 14:56:22 +0000</created>
                <updated>Wed, 1 Mar 2017 12:00:07 +0000</updated>
                            <resolved>Thu, 4 Sep 2014 17:20:00 +0000</resolved>
                                    <version>Lustre 2.4.3</version>
                                    <fixVersion>Lustre 2.7.0</fixVersion>
                    <fixVersion>Lustre 2.5.4</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>13</watches>
                                                                            <comments>
                            <comment id="89951" author="bruno.travouillon" created="Thu, 24 Jul 2014 15:43:02 +0000"  >&lt;p&gt;I forgot to notice that I read the content of the changelog.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;# lfs changelog scratch3-MDT0000 &amp;gt; scratch3-MDT0000.changelog.2
# ls -l scratch3-MDT0000.changelog.2
-rw-r--r-- 1 root root 46577682272 Jul 18 18:47 scratch3-MDT0000.changelog.2
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;First entries were from 19:46:00.582365844 2014.07.04&lt;br/&gt;
Last entries were from 14:09:43.370430939 2014.07.18&lt;/p&gt;

&lt;p&gt;There are 436,211,167 records in the file.&lt;/p&gt;</comment>
                            <comment id="90066" author="pjones" created="Fri, 25 Jul 2014 16:49:30 +0000"  >&lt;p&gt;Lai&lt;/p&gt;

&lt;p&gt;Could you please advise on this issue?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="90142" author="laisiyao" created="Mon, 28 Jul 2014 08:12:16 +0000"  >&lt;p&gt;Debug log doesn&apos;t show any errors, and as you said the change log is quite large, IMO this catalog contains too many llogs, and all of them are opened, and it took quite some time to iterate the open handle list to find the right handle for each record, and to increase this iteration, it should be done backward since the latest opened handle  is at the end. I&apos;ll commit a patch soon.&lt;/p&gt;</comment>
                            <comment id="90956" author="laisiyao" created="Wed, 6 Aug 2014 08:22:11 +0000"  >&lt;p&gt;Patch is on &lt;a href=&quot;http://review.whamcloud.com/#/c/11338/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/11338/&lt;/a&gt;, could you test with it? Sorry for the late update because I just get back from vacation.&lt;/p&gt;</comment>
                            <comment id="91513" author="laisiyao" created="Wed, 13 Aug 2014 09:19:38 +0000"  >&lt;p&gt;Each llog contains 60k records, so for your changelogs(400m records), it has almost 6k opened logs, I&apos;ve verified &lt;a href=&quot;http://review.whamcloud.com/#/c/11338/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/11338/&lt;/a&gt; works on my local test system with 2m records, which can always find the log from the head of the opened log handle list.&lt;/p&gt;</comment>
                            <comment id="92295" author="lixi" created="Mon, 25 Aug 2014 08:57:51 +0000"  >&lt;p&gt;Patch for master:&lt;br/&gt;
&lt;a href=&quot;http://review.whamcloud.com/11575&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/11575&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="93204" author="pjones" created="Thu, 4 Sep 2014 17:20:00 +0000"  >&lt;p&gt;Landed for 2.7&lt;/p&gt;</comment>
                            <comment id="94586" author="adegremont" created="Sun, 21 Sep 2014 13:18:55 +0000"  >&lt;p&gt;I think this fix should also be considered for 2.5.4&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="15416" name="debug.rpctrace.pid20076" size="440207" author="bruno.travouillon" created="Thu, 24 Jul 2014 14:56:22 +0000"/>
                            <attachment id="15419" name="robinhood-changelogclear.png" size="7990" author="bruno.travouillon" created="Thu, 24 Jul 2014 14:56:22 +0000"/>
                            <attachment id="15418" name="robinhood-readspeed-7days.png" size="9334" author="bruno.travouillon" created="Thu, 24 Jul 2014 14:56:22 +0000"/>
                            <attachment id="15417" name="robinhood-readspeed.png" size="16888" author="bruno.travouillon" created="Thu, 24 Jul 2014 14:56:22 +0000"/>
                            <attachment id="15415" name="robinhood.log.STATS.gz" size="1346266" author="bruno.travouillon" created="Thu, 24 Jul 2014 14:56:22 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10030" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Epic/Theme</customfieldname>
                        <customfieldvalues>
                                        <label>changelog</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzws6n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>15041</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>