1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="vfs_preopen.8">
6 <refentrytitle>vfs_preopen</refentrytitle>
7 <manvolnum>8</manvolnum>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">System Administration tools</refmiscinfo>
10 <refmiscinfo class="version">&doc.version;</refmiscinfo>
14 <refname>vfs_preopen</refname>
15 <refpurpose>Hide read latencies for applications reading numbered files</refpurpose>
20 <command>vfs objects = preopen</command>
25 <title>DESCRIPTION</title>
27 <para>This VFS module is part of the
28 <citerefentry><refentrytitle>samba</refentrytitle>
29 <manvolnum>7</manvolnum></citerefentry> suite.</para>
31 <para>This module assists applications that want to read numbered
32 files in sequence with very strict latency requirements. One area
33 where this happens in video streaming applications that want to read
34 one file per frame.</para>
36 <para>When you use this module, a number of helper processes is
37 started that speculatively open files and read a number of bytes to
38 prime the file system cache, so that later on when the real
39 application's request comes along, no disk access is necessary.</para>
41 <para>This module is stackable.</para>
47 <title>OPTIONS</title>
52 <term>preopen:posix-basic-regex = BOOL (default: no)</term>
55 <command>preopen:posix-basic-regex = yes</command> changes
56 the meaning of the <command>preopen:names</command> option.
57 Further details are described there.
63 <term>preopen:names = /pattern1/pattern2/</term>
66 preopen:names specifies the file name pattern(s) which should
67 trigger the preopen helpers to do their work. We assume that
68 the files are numbered incrementally. So if your file names
69 are numbered FRAME00000.frm FRAME00001.frm and so on you would
70 list them as <command>preopen:names=/FRAME*.frm/</command>.
71 The default algorithm uses the first (at least 3) digits it finds
72 in order to calculate the name of the next frames.
75 <para><command>preopen:posix-basic-regex = yes</command> changes
76 the meaning of the <command>preopen:names</command> option.
77 It means 'POSIX Basic Regular Expression' strings are used
78 as patterns. The key is each pattern requires exactly one
79 'subexpression' starting with '\(' and ending with '\)' in
80 order to specify the position of the digits representing
81 the incrementing frame numbers. Given a file names like
82 Movie7599Frame0v1234.txt, Movie7599Frame1v1234.txt, Movie7599Frame2v1234.txt
83 up to Movie7599Frame9v1234.txt you can use <command>preopen:names = /.*Frame\([0-9]\).*\.txt/</command>
84 in order to match just a single digits, this might not be a real world example,
85 but it shows the flexibility that is possible here.
92 <term>preopen:num_bytes = BYTES</term>
95 Specifies the number of bytes the helpers should speculatively
102 <term>preopen:helpers = NUM-PROCS</term>
105 Number of forked helper processes, defaults to 1.
111 <term>preopen:queuelen = NUM-FILES</term>
114 Number of files that should be speculatively opened. Defaults
115 to the 10 subsequent files.
121 <term>preopen:nomatch_log_level = LOGLEVEL</term>
124 In order to debug or audit the usage of the preopen logic
125 you can use this option to specify at what log level details
126 about filenames not matching any pattern from '<command>preopen:names</command>'
130 Defaults to the log level 5.
131 See also <citerefentry><refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
132 in the '<smbconfoption name="log level"/>' section
133 for special handling of the 'preopen' debug class.
139 <term>preopen:match_log_level = LOGLEVEL</term>
142 In order to debug or audit the usage of the preopen logic
143 you can use this option to specify at what log level details
144 about filenames actually matching a pattern from '<command>preopen:names</command>'
148 See also '<command>preopen:founddigits_log_level</command>' and '<command>preopen:push_log_level</command>'.
151 Defaults to the log level 5.
152 See also <citerefentry><refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
153 in the '<smbconfoption name="log level"/>' section
154 for special handling of the 'preopen' debug class.
160 <term>preopen:nodigits_log_level = LOGLEVEL</term>
163 In order to debug or audit problems with the preopen configuration
164 you can use this option to specify at what log level details
165 about filenames actually matching a pattern from '<command>preopen:names</command>',
166 but at the same time don't contain the expected digits, are logged.
167 This is typically something the administrator wants to notice and
168 adjust the configuration in order to define more precisely where to
169 find the digits in the filename.
172 Defaults to the log level 1.
173 See also <citerefentry><refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
174 in the '<smbconfoption name="log level"/>' section
175 for special handling of the 'preopen' debug class.
181 <term>preopen:founddigits_log_level = LOGLEVEL</term>
184 In order to debug or audit the usage of the preopen logic
185 you can use this option to specify at what log level details
186 about filenames actually matching a pattern from '<command>preopen:names</command>',
187 and at the same time having valid expected digits, are logged. This means enough information is available
188 in order to queue preopens.
191 Defaults to the log level 3.
192 See also <citerefentry><refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
193 in the '<smbconfoption name="log level"/>' section
194 for special handling of the 'preopen' debug class.
200 <term>preopen:reset_log_level = LOGLEVEL</term>
203 If a matching filename belongs to a different pattern from '<command>preopen:names</command>',
204 a different parent directory or differs in a significant way from the last filename
205 that was found before, the module needs to reset it's internal queue state.
206 This means that no more preopens will be pushed to helper processes belonging to the
207 former queue state. In order to debug or audit such queue resets you can use this option to specify at what
208 log level details are logged.
211 Defaults to the log level 5.
212 See also <citerefentry><refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
213 in the '<smbconfoption name="log level"/>' section
214 for special handling of the 'preopen' debug class.
220 <term>preopen:push_log_level = LOGLEVEL</term>
223 In order to debug or audit the usage of the preopen logic
224 you can use this option to specify at what log level details
225 about filenames actually pushed to preopen helper processes are logged.
226 This means they will actually be preopened soon.
229 Defaults to the log level 3.
230 See also <citerefentry><refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
231 in the '<smbconfoption name="log level"/>' section
232 for special handling of the 'preopen' debug class.
238 <term>preopen:queue_log_level = LOGLEVEL</term>
241 In order to debug details about internal queue processing
242 you can use this option to specify at what log level the details are logged.
245 Defaults to the log level 10.
246 See also <citerefentry><refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
247 in the '<smbconfoption name="log level"/>' section
248 for special handling of the 'preopen' debug class.
257 <title>VERSION</title>
258 <para>This man page is part of version &doc.version; of the Samba suite.
263 <title>AUTHOR</title>
265 <para>The original Samba software and related utilities
266 were created by Andrew Tridgell. Samba is now developed
267 by the Samba Team as an Open Source project similar
268 to the way the Linux kernel is developed.</para>
270 <para>The PREOPEN VFS module was created with contributions from
271 Volker Lendecke and the developers at IBM.