<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:43:41 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-11416] Improve readahead for random read of small/medium files</title>
                <link>https://jira.whamcloud.com/browse/LU-11416</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;For files that fit comfortably within the client RAM it would be possible to tune the readahead algorithm to fetch the entire file into the client RAM even with a totally random read workload (see e.g. &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5561&quot; title=&quot;Lustre random reads: 80% performance loss from 1.8 to 2.6&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5561&quot;&gt;&lt;del&gt;LU-5561&lt;/del&gt;&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;This behaviour can be simulated to some effect by setting the following parameters:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;lctl set_param llite.*.max_read_ahead_mb=16384 \
        llite.${Lustre_NID}\*.max_read_ahead_per_file_mb=1024 \
        llite.${Lustre_NID}\*.max_read_ahead_whole_mb=512
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;or similar.  This causes the Lustre client to read &lt;b&gt;all&lt;/b&gt; file data into cache if the file is &amp;lt;= 512MiB in size and is accessed more than once.  Performance testing shows that this can improve random 4KB reads dramatically compared to the default settings (64MiB, 64MiB, 2MiB respectively - 7574016 IOPS vs. 175616 IOPS.&lt;/p&gt;

&lt;p&gt;On the one hand, this might be considered &quot;cheating&quot; to read the whole file into RAM before doing random IOPS, but on the other hand if this behaviour can be generalized and is automatic for such workloads it is no more of a &quot;cheat&quot; than readahead or write-behind optimizations for a sequential workload.&lt;/p&gt;

&lt;p&gt;The main drawback from just increasing &lt;tt&gt;max_read_ahead_whole_mb&lt;/tt&gt; significantly is that this can have negative effects on some workloads that are only reading a small amount of data from many large files, such as reading an index/header from output files to find parameters, or &lt;tt&gt;file&lt;/tt&gt;/&lt;tt&gt;finder&lt;/tt&gt;/etc that read only the head/tail of a file to determine content.&lt;/p&gt;

&lt;p&gt;A reasonable compromise is to implement the &quot;read ahead whole file&quot; heuristics for files that have a significant number of random accesses, but can easily fit within the client RAM.  As a default starting point, we could add &lt;tt&gt;max_read_ahead_random_whole_mb&lt;/tt&gt; an &lt;tt&gt;max_read_ahead_random_ratio&lt;/tt&gt; parameters that encode this behaviour specifically.  The default file size could be something reasonable like &lt;tt&gt;totalram_pages / num_online_cpus / 2&lt;/tt&gt; (e.g. 1820MB for a 36-core 128GB client) and a ratio of 1/4096 pages read before triggering readahead.  &lt;/p&gt;

&lt;p&gt;That would mean a 1GB file would be fully prefetched after 64 random pages were read, and the maximum-sized 1820MB file would be fully prefetched after 113 pages are read.&lt;/p&gt;</description>
                <environment></environment>
        <key id="53387">LU-11416</key>
            <summary>Improve readahead for random read of small/medium files</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="1" iconUrl="https://jira.whamcloud.com/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="wc-triage">WC Triage</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>perf_optimization</label>
                            <label>readahead</label>
                    </labels>
                <created>Fri, 21 Sep 2018 23:28:38 +0000</created>
                <updated>Fri, 11 Aug 2023 16:03:31 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>10</watches>
                                                                                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="16129">LU-2032</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="26232">LU-5561</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="40684">LU-8709</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="54000">LU-11657</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="66627">LU-15100</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </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_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i002vz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>