Whamcloud - gitweb
LU-9069 tests: improve output of sanity test_255a
[fs/lustre-release.git] / lustre / doc / lfs-ladvise.1
1 .TH LFS-LADVISE 1 2015-11-30 "Lustre" "Lustre Utilities"
2 .SH NAME
3 lfs ladvise \- give file access advices or hints to server.
4 .SH SYNOPSIS
5 .br
6 .B lfs ladvise [--advice|-a ADVICE ] [--background|-b]
7         \fB[--start|-s START[kMGT]]
8         \fB{[--end|-e END[kMGT]] | [--length|-l LENGTH[kMGT]]}
9         \fB<FILE> ...\fR
10 .br
11 .SH DESCRIPTION
12 Give file access advices or hints to Lustre server side, usually OSS. This lfs
13 command is simlar to the Linux
14 .BR fadvise64 (2)
15 system call and
16 .BR posix_fadvise (2),
17 except it can forward the hints from Lustre clients to remote servers.
18 .SH OPTIONS
19 .TP
20 \fB\-a\fR, \fB\-\-advice\fR=\fIADVICE\fR
21 Give advice or hint of type \fIADVICE\fR. Advice types are:
22 .RS 1.2i
23 .TP
24 \fBwillread\fR to prefetch data into server cache
25 .TP
26 \fBdontneed\fR to cleanup data cache on server
27 .RE
28 .TP
29 \fB\-b\fR, \fB\-\-background
30 Enable the advices to be sent and handled asynchronously.
31 .TP
32 \fB\-s\fR, \fB\-\-start\fR=\fISTART_OFFSET\fR
33 File range starts from \fISTART_OFFSET\fR.
34 .TP
35 \fB\-e\fR, \fB\-\-end\fR=\fIEND_OFFSET\fR
36 File range ends at (not including) \fIEND_OFFSET\fR.
37 This option may not be specified at the same time as the -l option.
38 .TP
39 \fB\-l\fR, \fB\-\-length\fR=\fILENGTH\fR
40 File range has length of \fILENGTH\fR. This option may not be specified at the
41 same time as the -e option.
42 .SH NOTE
43 .PP
44 Typically,
45 .B lfs ladvise
46 forwards the advice to Lustre servers without
47 guaranteeing how and when servers will react to the advice. Actions may or
48 may not be triggered when the advices are recieved, depending on the type of
49 the advice, whether the backing filesystem type supports that advice, as well
50 as the real-time decision of the affected server-side components.
51
52 A typical usage of ladvise is to enable applications and users with external
53 knowledge to intervene in server-side cache management. For example, if a
54 group of different clients are doing small random reads of a file, prefetching
55 pages into OSS cache with big linear reads before the random IO is a net
56 benefit. Fetching that data into each client cache with fadvise() may not
57 be a benefit if any individual client only reads a subset of the file.
58
59 The main difference between Linux fadvise() system call and ladvise is that
60 fadvise() is only a client side mechanism that does not pass the advice to the
61 filesystem, while ladvise can send advices or hints to Lustre server sides.
62
63 .SH EXAMPLES
64 .TP
65 .B $ lfs ladvise -a willread -s 0 -e 1024M /mnt/lustre/file1
66 This gives the OST(s) holding the first 1GB of \fB/mnt/lustre/file1\fR a hint
67 that the first 1GB of that file will be read soon.
68 .TP
69 .B $ lfs ladvise -a dontneed -s 0 -e 1G /mnt/lustre/file1
70 This gives the OST(s) holding the first 1GB of \fB/mnt/lustre/file1\fR a hint
71 that the first 1GB of file will not be read in the near future, thus the OST(s)
72 could clear the cache of that file in the memory.
73 .SH AVAILABILITY
74 The lfs ladvise command is part of the Lustre filesystem.
75 .SH SEE ALSO
76 .BR lfs (1),
77 .BR fadvise64 (2),
78 .BR posix_fadvise (2),
79 .BR llapi_ladvise (3),
80 .BR lustre (7)