1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd-readahead-replay.service</title><meta name="generator" content="DocBook XSL Stylesheets V1.77.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><a href="index.html">Index </a>·
2
<a href="systemd.directives.html">Directives </a>·
3
<a href="../python-systemd/index.html">Python </a>·
4
<a href="../libudev/index.html">libudev </a>·
5
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 202</span><hr><div class="refentry"><a name="systemd-readahead-replay.service"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-readahead-replay.service, systemd-readahead-collect.service, systemd-readahead-done.service, systemd-readahead-done.timer, systemd-readahead — Disk read ahead logic</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename">systemd-readahead-replay.service</code></p><p><code class="filename">systemd-readahead-collect.service</code></p><p><code class="filename">systemd-readahead-done.service</code></p><p><code class="filename">systemd-readahead-done.timer</code></p><div class="cmdsynopsis"><p><code class="command">/usr/lib/systemd/systemd-readahead/systemd-readahead</code> [OPTIONS...] COMMAND [DIRECTORY | FILE]</p></div></div><div class="refsect1"><a name="idp29646576"></a><h2>Description</h2><p><code class="filename">systemd-readahead-collect.service</code>
6
is a service that collects disk usage patterns at boot
7
time. <code class="filename">systemd-readahead-replay.service</code>
8
is a service that replays this access data collected
9
at the subsequent boot. Since disks tend to be
10
magnitudes slower than RAM this is intended to improve
11
boot speeds by pre-loading early at boot all data on
12
disk that is known to be read for the complete boot
13
process.</p><p><code class="filename">systemd-readahead-done.service</code>
14
is executed a short while after boot completed and signals
15
<code class="filename">systemd-readahead-collect.service</code>
16
to end data collection. On this signal this service
17
will then sort the collected disk accesses and store
18
information about them disk in
19
<code class="filename">/.readahead</code>.</p><p>Normally, both
20
<code class="filename">systemd-readahead-collect.service</code>
22
<code class="filename">systemd-readahead-replay.service</code>
23
are activated at boot so that access patterns from the
24
preceding boot are replayed and new data collected
25
for the subsequent boot. However, on read-only media
26
where the collected data cannot be stored it might
27
be a good idea to disable
28
<code class="filename">systemd-readahead-collect.service</code>.</p><p>On rotating media, when replaying disk accesses
30
<code class="filename">systemd-readahead-replay.service</code>
31
will order read requests by their location on disk. On
32
non-rotating media, they will be ordered by their
33
original access timestamp. If the file system supports
35
<code class="filename">systemd-readahead-collect.service</code>
36
will also defragment and rearrange files on disk to
37
optimize subsequent boot times.</p></div><div class="refsect1"><a name="idp29428016"></a><h2>Options</h2><p><code class="filename">systemd-readahead</code> understands
38
the following options:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span></dt><dd><p>Prints a short help text
39
and exits.</p></dd><dt><span class="term"><code class="option">--max-files=</code></span></dt><dd><p>Maximum number of
40
files to read ahead. Only valid
41
for thes <span class="command"><strong>collect</strong></span>
42
command.</p></dd><dt><span class="term"><code class="option">--file-size-max=</code></span></dt><dd><p>Maximum size of files
43
(in bytes) to read ahead. Only valid
44
for the <span class="command"><strong>collect</strong></span>
45
and <span class="command"><strong>replay</strong></span>
46
commands.</p></dd><dt><span class="term"><code class="option">--timeout=</code></span></dt><dd><p>Maximum time (in usec)
47
to to spend collecting data. Only valid
48
for the <span class="command"><strong>collect</strong></span>
49
command.</p></dd></dl></div></div><div class="refsect1"><a name="idp30039376"></a><h2>Commands</h2><p>The following commands are understood by
50
<code class="filename">systemd-readahead</code>:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="command"><strong>collect
51
[<em class="replaceable"><code>DIRECTORY</code></em>]</strong></span></span></dt><dd><p>Collect read-ahead data on
52
early boot. When terminating it will
53
write out a pack file to the indicated
54
directory containing the read-ahead
55
data. </p></dd><dt><span class="term"><span class="command"><strong>replay
56
[<em class="replaceable"><code>DIRECTORY</code></em>]</strong></span></span></dt><dd><p>Perform read-ahead on the
57
specified directory tree.</p></dd><dt><span class="term"><span class="command"><strong>analyze
58
[<em class="replaceable"><code>FILE</code></em>]</strong></span></span></dt><dd><p>Dumps the content of the
59
read-ahead pack file to the
60
terminal. The output lists
61
approximately for each file
62
how much will be read-ahead by
63
the <span class="command"><strong>replay</strong></span>
64
command.</p></dd></dl></div></div><div class="refsect1"><a name="idp29033456"></a><h2>See Also</h2><p>
65
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>
66
</p></div></div></body></html>