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'>
27 <title>systemd-readahead-replay.service</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>systemd-readahead-replay.service</refentrytitle>
42 <manvolnum>8</manvolnum>
46 <refname>systemd-readahead-replay.service</refname>
47 <refname>systemd-readahead-collect.service</refname>
48 <refname>systemd-readahead-done.service</refname>
49 <refname>systemd-readahead-done.timer</refname>
50 <refname>systemd-readahead</refname>
51 <refpurpose>Disk read ahead logic</refpurpose>
55 <para><filename>systemd-readahead-replay.service</filename></para>
56 <para><filename>systemd-readahead-collect.service</filename></para>
57 <para><filename>systemd-readahead-done.service</filename></para>
58 <para><filename>systemd-readahead-done.timer</filename></para>
60 <command>/usr/lib/systemd/systemd-readahead/systemd-readahead</command>
61 <arg choice="opt" rep="repeat">OPTIONS</arg>
62 <arg choice="plain">COMMAND</arg>
63 <arg choice="opt">DIRECTORY | FILE</arg>
68 <title>Description</title>
70 <para><filename>systemd-readahead-collect.service</filename>
71 is a service that collects disk usage patterns at boot
72 time. <filename>systemd-readahead-replay.service</filename>
73 is a service that replays this access data collected
74 at the subsequent boot. Since disks tend to be
75 magnitudes slower than RAM, this is intended to improve
76 boot speeds by pre-loading early at boot all data on
77 disk that is known to be read for the complete boot
80 <para><filename>systemd-readahead-done.service</filename>
81 is executed a short while after boot completed and signals
82 <filename>systemd-readahead-collect.service</filename>
83 to end data collection. On this signal, this service
84 will then sort the collected disk accesses and store
85 information about them in
86 <filename>/.readahead</filename>.</para>
89 <filename>systemd-readahead-collect.service</filename>
91 <filename>systemd-readahead-replay.service</filename>
92 are activated at boot so that access patterns from the
93 preceding boot are replayed and new data collected
94 for the subsequent boot. However, on read-only media
95 where the collected data cannot be stored, it might
96 be a good idea to disable
97 <filename>systemd-readahead-collect.service</filename>.</para>
99 <para>On rotating media, when replaying disk accesses
101 <filename>systemd-readahead-replay.service</filename>
102 will order read requests by their location on disk. On
103 non-rotating media, they will be ordered by their
104 original access timestamp. If the file system supports
106 <filename>systemd-readahead-collect.service</filename>
107 will also defragment and rearrange files on disk to
108 optimize subsequent boot times.</para>
112 <title>Options</title>
114 <para><filename>systemd-readahead</filename> understands
115 the following options:</para>
119 <term><option>-h</option></term>
120 <term><option>--help</option></term>
122 <listitem><para>Prints a short help text
123 and exits.</para></listitem>
127 <term><option>--version</option></term>
129 <listitem><para>Prints a short version
130 string and exits.</para></listitem>
134 <term><option>--max-files=</option></term>
136 <listitem><para>Maximum number of
137 files to read ahead. Only valid
138 for thes <command>collect</command>
139 command.</para></listitem>
143 <term><option>--file-size-max=</option></term>
145 <listitem><para>Maximum size of files
146 in bytes to read ahead. Only valid
147 for the <command>collect</command>
148 and <command>replay</command>
149 commands.</para></listitem>
153 <term><option>--timeout=</option></term>
155 <listitem><para>Maximum time in microseconds
156 to spend collecting data. Only valid
157 for the <command>collect</command>
158 command.</para></listitem>
165 <title>Commands</title>
167 <para>The following commands are understood by
168 <filename>systemd-readahead</filename>:</para> <variablelist>
170 <term><command>collect
171 [<replaceable>DIRECTORY</replaceable>]</command></term>
173 <para>Collect read-ahead data on
174 early boot. When terminating, it will
175 write out a pack file to the indicated
176 directory containing the read-ahead
182 <term><command>replay
183 [<replaceable>DIRECTORY</replaceable>]</command></term>
185 <para>Perform read-ahead on the
186 specified directory tree.</para>
191 <term><command>analyze
192 [<replaceable>FILE</replaceable>]</command></term>
194 <para>Dumps the content of the
195 read-ahead pack file to the
196 terminal. For each file, the
197 output lists approximately how
198 much will be read ahead by
199 the <command>replay</command>
208 <title>See Also</title>
210 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>