ea11f0f99e5b766ec9b78cb43759129f080c0df2
[openafs.git] / doc / man-pages / pod8 / fileserver.pod
1 =head1 NAME
2
3 fileserver - Initializes the File Server component of the fs process
4
5 =head1 SYNOPSIS
6
7 =for html
8 <div class="synopsis">
9
10 B<fileserver> S<<< [B<-auditlog> <I<log path>>] >>>
11     S<<< [B<-d> <I<debug level>>] >>>
12     S<<< [B<-p> <I<number of processes>>] >>>
13     S<<< [B<-spare> <I<number of spare blocks>>] >>>
14     S<<< [B<-pctspare> <I<percentage spare>>] >>> S<<< [B<-b> <I<buffers>>] >>>
15     S<<< [B<-l> <I<large vnodes>>] >>> S<<< [B<-s> <I<small nodes>>] >>>
16     S<<< [B<-vc> <I<volume cachesize>>] >>> S<<< [B<-w> <I<call back wait interval>>] >>>
17     S<<< [B<-cb> <I<number of call backs>>] >>> [B<-banner>] [B<-novbc>]
18     S<<< [B<-implicit> <I<admin mode bits: rlidwka>>] >>> [B<-readonly>]
19     S<<< [B<-hr> <I<number of hours between refreshing the host cps>>] >>>
20     S<<< [B<-busyat> <I<< redirect clients when queue > n >>>] >>>
21     [B<-nobusy>] S<<< [B<-rxpck> <I<number of rx extra packets>>] >>>
22     [B<-rxdbg>] [B<-rxdbge>] S<<< [B<-rxmaxmtu> <I<bytes>>] >>>
23     S<<< [B<-rxbind> <I<address to bind the Rx socket to>>] >>>
24     S<<< [B<-vattachpar> <I<number of volume attach threads>>] >>>
25     S<<< [B<-m> <I<min percentage spare in partition>>] >>>
26     [B<-lock>] [B<-L>] [B<-S>] S<<< [B<-k> <I<stack size>>] >>>
27     S<<< [B<-realm> <I<Kerberos realm name>>] >>>
28     S<<< [B<-udpsize> <I<size of socket buffer in bytes>>] >>>
29     S<<< [B<-sendsize> <I<size of send buffer in bytes>>] >>>
30     S<<< [B<-abortthreshold> <I<abort threshold>>] >>>
31     S<<< [B<-auditlog> <I<path to log file>>] >>>
32     [B<-enable_peer_stats>] [B<-enable_process_stats>] [B<-help>]
33
34 =for html
35 </div>
36
37 =head1 DESCRIPTION
38
39 The B<fileserver> command initializes the File Server component of the
40 C<fs> process. In the conventional configuration, its binary file is
41 located in the F</usr/afs/bin> directory on a file server machine.
42
43 The B<fileserver> command is not normally issued at the command shell
44 prompt, but rather placed into a database server machine's
45 F</usr/afs/local/BosConfig> file with the B<bos create> command. If it is
46 ever issued at the command shell prompt, the issuer must be logged onto a
47 file server machine as the local superuser C<root>.
48
49 The File Server creates the F</usr/afs/logs/FileLog> log file as it
50 initializes, if the file does not already exist. It does not write a
51 detailed trace by default, but the B<-d> option may be used to
52 increase the amount of detail. Use the B<bos getlog> command to
53 display the contents of the log file.
54
55 The command's arguments enable the administrator to control many aspects
56 of the File Server's performance, as detailed in L<OPTIONS>.  By default
57 the B<fileserver> command sets values for many arguments that are suitable
58 for a medium-sized file server machine. To set values suitable for a small
59 or large file server machine, use the B<-S> or B<-L> flag
60 respectively. The following list describes the parameters and
61 corresponding argument for which the B<fileserver> command sets default
62 values, and the table below summarizes the setting for each of the three
63 machine sizes.
64
65 =over 4
66
67 =item *
68
69 The maximum number of lightweight processes (LWPs) the File Server uses to
70 handle requests for data; corresponds to the B<-p> argument. The File
71 Server always uses a minimum of 32 KB of memory for these processes.
72
73 =item *
74
75 The maximum number of directory blocks the File Server caches in memory;
76 corresponds to the B<-b> argument. Each cached directory block (buffer)
77 consumes 2,092 bytes of memory.
78
79 =item *
80
81 The maximum number of large vnodes the File Server caches in memory for
82 tracking directory elements; corresponds to the B<-l> argument. Each large
83 vnode consumes 292 bytes of memory.
84
85 =item *
86
87 The maximum number of small vnodes the File Server caches in memory for
88 tracking file elements; corresponds to the B<-s> argument.  Each small
89 vnode consumes 100 bytes of memory.
90
91 =item *
92
93 The maximum volume cache size, which determines how many volumes the File
94 Server can cache in memory before having to retrieve data from disk;
95 corresponds to the B<-vc> argument.
96
97 =item *
98
99 The maximum number of callback structures the File Server caches in
100 memory; corresponds to the B<-cb> argument. Each callback structure
101 consumes 16 bytes of memory.
102
103 =item *
104
105 The maximum number of Rx packets the File Server uses; corresponds to the
106 B<-rxpck> argument. Each packet consumes 1544 bytes of memory.
107
108 =back
109
110 The default values are:
111
112   Parameter (Argument)               Small (-S)     Medium   Large (-L)
113   ---------------------------------------------------------------------
114   Number of LWPs (-p)                        6           9           12
115   Number of cached dir blocks (-b)          70          90          120
116   Number of cached large vnodes (-l)       200         400          600
117   Number of cached small vnodes (-s)       200         400          600
118   Maximum volume cache size (-vc)          200         400          600
119   Number of callbacks (-cb)             20,000      60,000       64,000
120   Number of Rx packets (-rxpck)            100         150          200
121
122 To override any of the values, provide the indicated argument (which can
123 be combined with the B<-S> or B<-L> flag).
124
125 The amount of memory required for the File Server varies. The approximate
126 default memory usage is 751 KB when the B<-S> flag is used (small
127 configuration), 1.1 MB when all defaults are used (medium configuration),
128 and 1.4 MB when the B<-L> flag is used (large configuration). If
129 additional memory is available, increasing the value of the B<-cb> and
130 B<-vc> arguments can improve File Server performance most directly.
131
132 By default, the File Server allows a volume to exceed its quota by 1 MB
133 when an application is writing data to an existing file in a volume that
134 is full. The File Server still does not allow users to create new files in
135 a full volume. To change the default, use one of the following arguments:
136
137 =over 4
138
139 =item *
140
141 Set the B<-spare> argument to the number of extra kilobytes that the File
142 Server allows as overage. A value of C<0> allows no overage.
143
144 =item *
145
146 Set the B<-pctspare> argument to the percentage of the volume's quota the
147 File Server allows as overage.
148
149 =back
150
151 By default, the File Server implicitly grants the C<a> (administer) and
152 C<l> (lookup) permissions to system:administrators on the access control
153 list (ACL) of every directory in the volumes stored on its file server
154 machine. In other words, the group's members can exercise those two
155 permissions even when an entry for the group does not appear on an ACL. To
156 change the set of default permissions, use the B<-implicit> argument.
157
158 The File Server maintains a I<host current protection subgroup> (I<host
159 CPS>) for each client machine from which it has received a data access
160 request. Like the CPS for a user, a host CPS lists all of the Protection
161 Database groups to which the machine belongs, and the File Server compares
162 the host CPS to a directory's ACL to determine in what manner users on the
163 machine are authorized to access the directory's contents. When the B<pts
164 adduser> or B<pts removeuser> command is used to change the groups to
165 which a machine belongs, the File Server must recompute the machine's host
166 CPS in order to notice the change. By default, the File Server contacts
167 the Protection Server every two hours to recompute host CPSs, implying
168 that it can take that long for changed group memberships to become
169 effective. To change this frequency, use the B<-hr> argument.
170
171 The File Server stores volumes in partitions. A partition is a
172 filesystem or directory on the server machine that is named C</vicepX>
173 or C</vicepXX> where XX is "a" through "z" or "aa" though "zz". The
174 File Server expects that the /vicepXX directories are each on a
175 dedicated filesystem. The File Server will only use a /vicepXX if it's
176 a mountpoint for another filesystem, unless the file
177 C</vicepXX/AlwaysAttach> exists. The data in the partition is a
178 special format that can only be access using OpenAFS commands or an
179 OpenAFS client.
180
181 The File Server generates the following message when a partition is nearly
182 full:
183
184    No space left on device
185
186 This command does not use the syntax conventions of the AFS command
187 suites. Provide the command name and all option names in full.
188
189 =head1 CAUTIONS
190
191 Do not use the B<-k> and B<-w> arguments, which are intended for use
192 by the AFS Development group only. Changing them from their default
193 values can result in unpredictable File Server behavior.  In any case,
194 on many operating systems the File Server uses native threads rather
195 than the LWP threads, so using the B<-k> argument to set the number of
196 LWP threads has no effect.
197
198 Do not specify both the B<-spare> and B<-pctspare> arguments. Doing so
199 causes the File Server to exit, leaving an error message in the
200 F</usr/afs/logs/FileLog> file.
201
202 Options that are available only on some system types, such as the B<-m>
203 and B<-lock> options, appear in the output generated by the B<-help>
204 option only on the relevant system type.
205
206 =head1 OPTIONS
207
208 =over 4
209
210 =item B<-auditlog> <I<log path>>
211
212 Set and enable auditing.
213
214 =item B<-d> <I<debug level>>
215
216 Sets the detail level for the debugging trace written to the
217 F</usr/afs/logs/FileLog> file. Provide one of the following values, each
218 of which produces an increasingly detailed trace: C<0>, C<1>, C<5>, C<25>,
219 and C<125>. The default value of C<0> produces only a few messages.
220
221 =item B<-p> <I<number of processes>>
222
223 Sets the number of threads to run. Provide a positive integer. The File
224 Server creates and uses five threads for special purposes, in addition to
225 the number specified (but if this argument specifies the maximum possible
226 number, the File Server automatically uses five of the threads for its own
227 purposes).
228
229 The maximum number of threads can differ in each release of AFS.  Consult
230 the I<IBM AFS Release Notes> for the current release.
231
232 =item B<-spare> <I<number of spare blocks>>
233
234 Specifies the number of additional kilobytes an application can store in a
235 volume after the quota is exceeded. Provide a positive integer; a value of
236 C<0> prevents the volume from ever exceeding its quota. Do not combine
237 this argument with the B<-pctspare> argument.
238
239 =item B<-pctspare> <I<percentage spare>>
240
241 Specifies the amount by which the File Server allows a volume to exceed
242 its quota, as a percentage of the quota. Provide an integer between C<0>
243 and C<99>. A value of C<0> prevents the volume from ever exceeding its
244 quota. Do not combine this argument with the B<-spare> argument.
245
246 =item B<-b> <I<buffers>>
247
248 Sets the number of directory buffers. Provide a positive integer.
249
250 =item B<-l> <I<large vnodes>>
251
252 Sets the number of large vnodes available in memory for caching directory
253 elements. Provide a positive integer.
254
255 =item B<-s> <I<small nodes>>
256
257 Sets the number of small vnodes available in memory for caching file
258 elements. Provide a positive integer.
259
260 =item B<-vc> <I<volume cachesize>>
261
262 Sets the number of volumes the File Server can cache in memory.  Provide a
263 positive integer.
264
265 =item B<-w> <I<call back wait interval>>
266
267 Sets the interval at which the daemon spawned by the File Server performs
268 its maintenance tasks. Do not use this argument; changing the default
269 value can cause unpredictable behavior.
270
271 =item B<-cb> <I<number of callbacks>>
272
273 Sets the number of callbacks the File Server can track. Provide a positive
274 integer.
275
276 =item B<-banner>
277
278 Prints the following banner to F</dev/console> about every 10 minutes.
279
280    File Server is running at I<time>.
281
282 =item B<-novbc>
283
284 Prevents the File Server from breaking the callbacks that Cache Managers
285 hold on a volume that the File Server is reattaching after the volume was
286 offline (as a result of the B<vos restore> command, for example). Use of
287 this flag is strongly discouraged.
288
289 =item B<-implicit> <I<admin mode bits>>
290
291 Defines the set of permissions granted by default to the
292 system:administrators group on the ACL of every directory in a volume
293 stored on the file server machine. Provide one or more of the standard
294 permission letters (C<rlidwka>) and auxiliary permission letters
295 (C<ABCDEFGH>), or one of the shorthand notations for groups of permissions
296 (C<all>, C<none>, C<read>, and C<write>). To review the meaning of the
297 permissions, see the B<fs setacl> reference page.
298
299 =item B<-hr> <I<number of hours between refreshing the host cps>>
300
301 Specifies how often the File Server refreshes its knowledge of the
302 machines that belong to protection groups (refreshes the host CPSs for
303 machines). The File Server must update this information to enable users
304 from machines recently added to protection groups to access data for which
305 those machines now have the necessary ACL permissions.
306
307 =item B<-busyat> <I<< redirect clients when queue > n >>>
308
309 Defines the number of incoming RPCs that can be waiting for a response
310 from the File Server before the File Server returns the error code
311 C<VBUSY> to the Cache Manager that sent the latest RPC. In response, the
312 Cache Manager retransmits the RPC after a delay. This argument prevents
313 the accumulation of so many waiting RPCs that the File Server can never
314 process them all. Provide a positive integer.  The default value is
315 C<600>.
316
317 =item B<-rxpck> <I<number of rx extra packets>>
318
319 Controls the number of Rx packets the File Server uses to store data for
320 incoming RPCs that it is currently handling, that are waiting for a
321 response, and for replies that are not yet complete. Provide a positive
322 integer.
323
324 =item B<-rxdbg>
325
326 Writes a trace of the File Server's operations on Rx packets to the file
327 F</usr/afs/logs/rx_dbg>.
328
329 =item F<-rxdbge>
330
331 Writes a trace of the File Server's operations on Rx events (such as
332 retransmissions) to the file F</usr/afs/logs/rx_dbg>.
333
334 =item F<-m> <I<min percentage spare in partition>>
335
336 Specifies the percentage of each AFS server partition that the AIX version
337 of the File Server creates as a reserve. Specify an integer value between
338 C<0> and C<30>; the default is 8%. A value of C<0> means that the
339 partition can become completely full, which can have serious negative
340 consequences.
341
342 =item B<-lock>
343
344 Prevents any portion of the fileserver binary from being paged (swapped)
345 out of memory on a file server machine running the IRIX operating system.
346
347 =item B<-L>
348
349 Sets values for many arguments in a manner suitable for a large file
350 server machine. Combine this flag with any option except the B<-S> flag;
351 omit both flags to set values suitable for a medium-sized file server
352 machine.
353
354 =item B<-S>
355
356 Sets values for many arguments in a manner suitable for a small file
357 server machine. Combine this flag with any option except the B<-L> flag;
358 omit both flags to set values suitable for a medium-sized file server
359 machine.
360
361 =item B<-k> <I<stack size>>
362
363 Sets the LWP stack size in units of 1 kilobyte. Do not use this argument,
364 and in particular do not specify a value less than the default of C<24>.
365
366 =item B<-realm> <I<Kerberos realm name>>
367
368 Defines the Kerberos realm name for the File Server to use. If this
369 argument is not provided, it uses the realm name corresponding to the cell
370 listed in the local F</usr/afs/etc/ThisCell> file.
371
372 =item B<-udpsize> <I<size of socket buffer in bytes>>
373
374 Sets the size of the UDP buffer, which is 64 KB by default. Provide a
375 positive integer, preferably larger than the default.
376
377 =item B<-enable_peer_stats>
378
379 Activates the collection of Rx statistics and allocates memory for their
380 storage. For each connection with a specific UDP port on another machine,
381 a separate record is kept for each type of RPC (FetchFile, GetStatus, and
382 so on) sent or received. To display or otherwise access the records, use
383 the Rx Monitoring API.
384
385 =item B<-enable_process_stats>
386
387 Activates the collection of Rx statistics and allocates memory for their
388 storage. A separate record is kept for each type of RPC (FetchFile,
389 GetStatus, and so on) sent or received, aggregated over all connections to
390 other machines. To display or otherwise access the records, use the Rx
391 Monitoring API.
392
393 =item B<-help>
394
395 Prints the online help for this command. All other valid options are
396 ignored.
397
398 =back
399
400 =head1 EXAMPLES
401
402 The following B<bos create> command creates an fs process on the file
403 server machine C<fs2.abc.com> that uses the large configuration size, and
404 allows volumes to exceed their quota by 10%. Type the command on a single
405 line:
406
407    % bos create -server fs2.abc.com -instance fs -type fs \
408                 -cmd "/usr/afs/bin/fileserver -pctspare 10 \
409                 -L" /usr/afs/bin/volserver /usr/afs/bin/salvager
410
411
412 =head1 TROUBLESHOOTING
413
414 Sending process signals to the File Server Process can change its
415 behavior in the following ways:
416
417   Process          Signal       OS     Result
418   ---------------------------------------------------------------------
419
420   File Server      XCPU        Unix    Prints a list of client IP
421                                        Addresses.
422
423   File Server      USR2      Windows   Prints a list of client IP
424                                        Addresses.
425
426   File Server      POLL        HPUX    Prints a list of client IP
427                                        Addresses.
428
429   Any server       TSTP        Any     Increases Debug level by a power
430                                        of 5 -- 1,5,25,125, etc.
431                                        This has the same effect as the
432                                        -debug XXX command-line option.
433
434   Any Server       HUP         Any     Resets Debug level to 0
435
436   File Server      TERM        Any     Run minor instrumentation over
437                                        the list of descriptors.
438
439   Other Servers    TERM        Any     Causes the process to quit.
440
441   File Server      QUIT        Any     Causes the File Server to Quit.
442                                        Bos Server knows this.
443
444 The basic metric of whether an AFS file server is doing well is the number
445 of connections waiting for a thread,
446 which can be found by running the following command:
447
448    % rxdebug <server> | grep waiting_for | wc -l
449
450 Each line returned by C<rxdebug> that contains the text "waiting_for"
451 represents a connection that's waiting for a file server thread.
452
453 If the blocked connection count is ever above 0, the server is having
454 problems replying to clients in a timely fashion.  If it gets above 10,
455 roughly, there will be noticable slowness by the user.  The total number of
456 connections is a mostly irrelevant number that goes essentially
457 monotonically for as long as the server has been running and then goes back
458 down to zero when it's restarted.
459
460 The most common cause of blocked connections rising on a server is some
461 process somewhere performing an abnormal number of accesses to that server
462 and its volumes.  If multiple servers have a blocked connection count, the
463 most likely explanation is that there is a volume replicated between those
464 servers that is absorbing an abnormally high access rate.
465
466 To get an access count on all the volumes on a server, run:
467
468    % vos listvol <server> -long
469
470 and save the output in a file.  The results will look like a bunch of B<vos
471 examine> output for each volume on the server.  Look for lines like:
472
473    40065 accesses in the past day (i.e., vnode references)
474
475 and look for volumes with an abnormally high number of accesses.  Anything
476 over 10,000 is fairly high, but some volumes like root.cell and other
477 volumes close to the root of the cell will have that many hits routinely.
478 Anything over 100,000 is generally abnormally high.  The count resets about
479 once a day.
480
481 Another approach that can be used to narrow the possibilities for a
482 replicated volume, when multiple servers are having trouble, is to find all
483 replicated volumes for that server.  Run:
484
485    % vos listvldb -server <server>
486
487 where <server> is one of the servers having problems to refresh the VLDB
488 cache, and then run:
489
490    % vos listvldb -server <server> -part <partition>
491
492 to get a list of all volumes on that server and partition, including every
493 other server with replicas.
494
495 Once the volume causing the problem has been identified, the best way to
496 deal with the problem is to move that volume to another server with a low
497 load or to stop any runaway programs that are accessing that volume
498 unnecessarily.  Often the volume will be enough information to tell what's
499 going on.
500
501 If you still need additional information about who's hitting that server,
502 sometimes you can guess at that information from the failed callbacks in the
503 F<FileLog> log in F</var/log/afs> on the server, or from the output of:
504
505    % /usr/afsws/etc/rxdebug <server> -rxstats
506
507 but the best way is to turn on debugging output from the file server.
508 (Warning: This generates a lot of output into FileLog on the AFS server.)
509 To do this, log on to the AFS server, find the PID of the fileserver
510 process, and do:
511
512     kill -TSTP <pid>
513
514 where <pid> is the PID of the file server process.  This will raise the
515 debugging level so that you'll start seeing what people are actually doing
516 on the server.  You can do this up to three more times to get even more
517 output if needed.  To reset the debugging level back to normal, use (The
518 following command will NOT terminate the file server):
519
520     kill -HUP <pid>
521
522 The debugging setting on the File Server should be reset back to normal when
523 debugging is no longer needed.  Otherwise, the AFS server may well fill its
524 disks with debugging output.
525
526 The lines of the debugging output that are most useful for debugging load
527 problems are:
528
529     SAFS_FetchStatus,  Fid = 2003828163.77154.82248, Host 171.64.15.76
530     SRXAFS_FetchData, Fid = 2003828163.77154.82248
531
532 (The example above is partly truncated to highlight the interesting
533 information).  The Fid identifies the volume and inode within the volume;
534 the volume is the first long number.  So, for example, this was:
535
536    % vos examine 2003828163
537    pubsw.matlab61                   2003828163 RW    1040060 K  On-line
538        afssvr5.Stanford.EDU /vicepa 
539        RWrite 2003828163 ROnly 2003828164 Backup 2003828165 
540        MaxQuota    3000000 K 
541        Creation    Mon Aug  6 16:40:55 2001
542        Last Update Tue Jul 30 19:00:25 2002
543        86181 accesses in the past day (i.e., vnode references)
544
545        RWrite: 2003828163    ROnly: 2003828164    Backup: 2003828165
546        number of sites -> 3
547           server afssvr5.Stanford.EDU partition /vicepa RW Site 
548           server afssvr11.Stanford.EDU partition /vicepd RO Site 
549           server afssvr5.Stanford.EDU partition /vicepa RO Site 
550
551 and from the Host information one can tell what system is accessing that
552 volume.
553
554 Note that the output of L<vos_examine(1)> also includes the access count, so
555 once the problem has been identified, vos examine can be used to see if the
556 access count is still increasing.  Also remember that you can run vos
557 examine on the read-only replica (e.g., pubsw.matlab61.readonly) to see the
558 access counts on the read-only replica on all of the servers that it's
559 located on.
560
561 =head1 PRIVILEGE REQUIRED
562
563 The issuer must be logged in as the superuser C<root> on a file server
564 machine to issue the command at a command shell prompt.  It is conventional
565 instead to create and start the process by issuing the B<bos create>
566 command.
567
568 =head1 SEE ALSO
569
570 L<BosConfig(5)>,
571 L<FileLog(5)>,
572 L<bos_create(8)>,
573 L<bos_getlog(8)>,
574 L<fs_setacl(1)>,
575 L<salvager(8)>,
576 L<volserver(8)>,
577 L<vos_examine(1)>
578
579 =head1 COPYRIGHT
580
581 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
582
583 This documentation is covered by the IBM Public License Version 1.0.  It was
584 converted from HTML to POD by software written by Chas Williams and Russ
585 Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.