Update Red Hat Copyright Notices
[nbdkit.git] / filters / delay / nbdkit-delay-filter.pod
blob825dbb2253f95f33ed9b31b4b8ef586a3040f24d
1 =head1 NAME
3 nbdkit-delay-filter - nbdkit delay filter
5 =head1 SYNOPSIS
7  nbdkit --filter=delay plugin rdelay=SECS wdelay=SECS [plugin-args...]
9 =for paragraph
11  nbdkit --filter=delay plugin rdelay=NNms wdelay=NNms [plugin-args...]
13 =for paragraph
15  nbdkit --filter=delay plugin [plugin-args ...]
16           delay-read=(SECS|NNms)
17           delay-write=(SECS|NNms)
18           delay-zero=(SECS|NNms)
19           delay-trim=(SECS|NNms)
20           delay-extents=(SECS|NNms)
21           delay-cache=(SECS|NNms)
22           delay-fast-zero=BOOL
23           delay-open=(SECS|NNms)
24           delay-close=(SECS|NNms)
26 =head1 DESCRIPTION
28 C<nbdkit-delay-filter> is a filter that delays read and write requests
29 by some seconds or milliseconds.  This is used to simulate a slow or
30 remote server, or to test certain kinds of race conditions in Linux.
31 To limit server bandwidth use L<nbdkit-rate-filter(1)> instead.
33 =head1 EXAMPLES
35 Delays reads and writes by 100ms:
37  nbdkit --filter=delay file disk.img rdelay=100ms wdelay=100ms
39 Delay only zero operations by 1 second, nothing else is affected:
41  nbdkit --filter=delay file disk.img delay-zero=1
43 =head1 PARAMETERS
45 =over 4
47 =item B<rdelay=>SECS
49 =item B<rdelay=>NNB<ms>
51 =item B<delay-read=>SECS
53 =item B<delay-read=>NNB<ms>
55 Delay read operations by C<SECS> seconds or C<NN> milliseconds.
57 The two forms C<rdelay> and C<delay-read> work identically.
59 =item B<delay-write=>SECS
61 =item B<delay-write=>NNB<ms>
63 Delay write operations by C<SECS> seconds or C<NN> milliseconds.
65 =item B<delay-zero=>SECS
67 =item B<delay-zero=>NNB<ms>
69 (nbdkit E<ge> 1.10)
71 Delay zero operations by C<SECS> seconds or C<NN> milliseconds.  See
72 also B<delay-fast-zero>.
74 =item B<delay-trim=>SECS
76 =item B<delay-trim=>NNB<ms>
78 (nbdkit E<ge> 1.10)
80 Delay trim/discard operations by C<SECS> seconds or C<NN> milliseconds.
82 =item B<delay-extents=>SECS
84 =item B<delay-extents=>NNB<ms>
86 (nbdkit E<ge> 1.12)
88 Delay block status (extents) operations by C<SECS> seconds or C<NN>
89 milliseconds.
91 =item B<delay-cache=>SECS
93 =item B<delay-cache=>NNB<ms>
95 (nbdkit E<ge> 1.14)
97 Delay advisory cache operations by C<SECS> seconds or C<NN>
98 milliseconds.
100 =item B<wdelay=>SECS
102 =item B<wdelay=>NNB<ms>
104 Delay write, zero and trim operations by C<SECS> seconds or C<NN>
105 milliseconds.
107 =item B<delay-fast-zero=>BOOL
109 (nbdkit E<ge> 1.16)
111 The NBD specification documents an extension called fast zero, in
112 which the client may request that a server should reply with
113 C<ENOTSUP> as soon as possible if the zero operation offers no real
114 speedup over a corresponding write.  By default, this parameter is
115 true, and fast zero requests are serviced by the plugin after the same
116 delay as any other zero request; but setting this parameter to false
117 instantly fails a fast zero response without waiting for or consulting
118 the plugin.
120 =item B<delay-open=>SECS
122 =item B<delay-open=>NNB<ms>
124 (nbdkit E<ge> 1.28)
126 Delay open (client connection) by C<SECS> seconds or C<NN>
127 milliseconds.
129 =item B<delay-close=>SECS
131 =item B<delay-close=>NNB<ms>
133 (nbdkit E<ge> 1.28)
135 Delay close (client disconnection) by C<SECS> seconds or C<NN>
136 milliseconds.  This can also cause server shutdown to be delayed if
137 clients are connected at the time.  This only affects clients that
138 gracefully disconnect (using C<NBD_CMD_DISC> / libnbd function
139 L<nbd_shutdown(3)>).  Clients that abruptly disconnect from the server
140 cannot be delayed.
142 =back
144 =head1 FILES
146 =over 4
148 =item F<$filterdir/nbdkit-delay-filter.so>
150 The filter.
152 Use C<nbdkit --dump-config> to find the location of C<$filterdir>.
154 =back
156 =head1 VERSION
158 C<nbdkit-delay-filter> first appeared in nbdkit 1.2, based on earlier
159 C<rdelay> and C<wdelay> options in L<nbdkit-file-plugin(1)>.
161 =head1 SEE ALSO
163 L<nbdkit(1)>,
164 L<nbdkit-filter(3)>,
165 L<nbdkit-pause-filter(1)>,
166 L<nbdkit-rate-filter(1)>.
168 =head1 AUTHORS
170 Richard W.M. Jones
172 =head1 COPYRIGHT
174 Copyright Red Hat