1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 This file is part of systemd.
8 Copyright 2010 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 <refentry id="systemd-readahead-replay.service" conditional='ENABLE_READAHEAD'
25 xmlns:xi="http://www.w3.org/2001/XInclude">
28 <title>systemd-readahead-replay.service</title>
29 <productname>systemd</productname>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
42 <refentrytitle>systemd-readahead-replay.service</refentrytitle>
43 <manvolnum>8</manvolnum>
47 <refname>systemd-readahead-replay.service</refname>
48 <refname>systemd-readahead-collect.service</refname>
49 <refname>systemd-readahead-done.service</refname>
50 <refname>systemd-readahead-done.timer</refname>
51 <refname>systemd-readahead</refname>
52 <refpurpose>Disk read ahead logic</refpurpose>
56 <para><filename>systemd-readahead-replay.service</filename></para>
57 <para><filename>systemd-readahead-collect.service</filename></para>
58 <para><filename>systemd-readahead-done.service</filename></para>
59 <para><filename>systemd-readahead-done.timer</filename></para>
61 <command>/usr/lib/systemd/systemd-readahead/systemd-readahead</command>
62 <arg choice="opt" rep="repeat">OPTIONS</arg>
63 <arg choice="plain">COMMAND</arg>
64 <arg choice="opt">DIRECTORY | FILE</arg>
69 <title>Description</title>
71 <para><filename>systemd-readahead-collect.service</filename>
72 is a service that collects disk usage patterns at boot
73 time. <filename>systemd-readahead-replay.service</filename>
74 is a service that replays this access data collected
75 at the subsequent boot. Since disks tend to be
76 magnitudes slower than RAM, this is intended to improve
77 boot speeds by pre-loading early at boot all data on
78 disk that is known to be read for the complete boot
81 <para><filename>systemd-readahead-done.service</filename>
82 is executed a short while after boot completed and signals
83 <filename>systemd-readahead-collect.service</filename>
84 to end data collection. On this signal, this service
85 will then sort the collected disk accesses and store
86 information about them in
87 <filename>/.readahead</filename>.</para>
90 <filename>systemd-readahead-collect.service</filename>
92 <filename>systemd-readahead-replay.service</filename>
93 are activated at boot so that access patterns from the
94 preceding boot are replayed and new data collected
95 for the subsequent boot. However, on read-only media
96 where the collected data cannot be stored, it might
97 be a good idea to disable
98 <filename>systemd-readahead-collect.service</filename>.</para>
100 <para>On rotating media, when replaying disk accesses
102 <filename>systemd-readahead-replay.service</filename>
103 will order read requests by their location on disk. On
104 non-rotating media, they will be ordered by their
105 original access timestamp. If the file system supports
107 <filename>systemd-readahead-collect.service</filename>
108 will also defragment and rearrange files on disk to
109 optimize subsequent boot times.</para>
113 <title>Options</title>
115 <para><filename>systemd-readahead</filename> understands
116 the following options:</para>
120 <term><option>--files-max=</option></term>
122 <listitem><para>Maximum number of
123 files to read ahead. Only valid
124 for thes <command>collect</command>
125 command.</para></listitem>
129 <term><option>--file-size-max=</option></term>
131 <listitem><para>Maximum size of files
132 in bytes to read ahead. Only valid
133 for the <command>collect</command>
134 and <command>replay</command>
135 commands.</para></listitem>
139 <term><option>--timeout=</option></term>
141 <listitem><para>Maximum time in microseconds
142 to spend collecting data. Only valid
143 for the <command>collect</command>
144 command.</para></listitem>
147 <xi:include href="standard-options.xml" xpointer="help" />
148 <xi:include href="standard-options.xml" xpointer="version" />
154 <title>Commands</title>
156 <para>The following commands are understood by
157 <filename>systemd-readahead</filename>:</para> <variablelist>
159 <term><command>collect
160 [<replaceable>DIRECTORY</replaceable>]</command></term>
162 <para>Collect read-ahead data on
163 early boot. When terminating, it will
164 write out a pack file to the indicated
165 directory containing the read-ahead
171 <term><command>replay
172 [<replaceable>DIRECTORY</replaceable>]</command></term>
174 <para>Perform read-ahead on the
175 specified directory tree.</para>
180 <term><command>analyze
181 [<replaceable>FILE</replaceable>]</command></term>
183 <para>Dumps the content of the
184 read-ahead pack file to the
185 terminal. For each file, the
186 output lists approximately how
187 much will be read ahead by
188 the <command>replay</command>
197 <title>See Also</title>
199 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>