Add proper per-file copyright notices/licenses and top-level license.
[bluesky.git] / TBBT / trace_play / sfs.1
1 .\" @(#)sfs.1  2.1     97/10/23
2 .\" See DESCR.SFS file for restrictions
3 .\"
4 .\" create man page by running 'tbl sfs.1 | nroff -man > sfs.cat'
5 .\"
6 .TH SFS 1 "5 October 1994"
7 .SH NAME
8 SFS \- Network File System server benchmark program
9 .SH SYNOPSIS
10 .B sfs
11 [
12 .B \-a access_pcnt
13 ] [
14 .B \-A append_pcnt
15 ]
16 .br
17 [
18 .B \-b blocksz_file
19 ] [
20 .B \-B block_size
21 ] [
22 .B \-d debug_level
23 ]
24 .br
25 [
26 .B \-D dir_cnt
27 ] [
28 .B \-f file_set_delta
29 ] [
30 .B \-F file_cnt
31 ] [
32 .B \-i
33 ] [
34 .B \-l load
35 ]
36 .br
37 [
38 .B \-m mix_file
39 ] [
40 .B \-M prime_client_hostname
41 ]
42 .br
43 [
44 .B \-N client_num
45 ] [
46 .B \-p processes
47 ] [
48 .B \-P
49 ] [
50 .B \-Q
51 ]
52 .br
53 [
54 .B \-R biod_reads
55 ] [
56 [
57 .B \-S symlink_cnt
58 ] [
59 .B \-t time
60 ] [
61 .B \-T
62 ]
63 .br
64 [
65 .B \-V
66 ] [
67 .B \-W biod_writes
68 ] [
69 .B \-w warmup_time
70 ] [
71 .B \-z
72 ]
73 .br
74 [
75 .B server:/directory ...
76 ]
77 .LP
78 .B sfs3
79 [
80 .B \-a access_pcnt
81 ] [
82 .B \-A append_pcnt
83 ]
84 .br
85 [
86 .B \-b blocksz_file
87 ] [
88 .B \-B block_size
89 ] [
90 .B \-d debug_level
91 ]
92 .br
93 [
94 .B \-D dir_cnt
95 ] [
96 .B \-f file_set_delta
97 ] [
98 .B \-F file_cnt
99 ] [
100 .B \-i
101 ] [
102 .B \-l load
103 ]
104 .br
105 [
106 .B \-m mix_file
107 ] [
108 .B \-M prime_client_hostname
109 ]
110 .br
111 [
112 .B \-N client_num
113 ] [
114 .B \-p processes
115 ] [
116 .B \-P
117 ] [
118 .B \-Q
119 ]
120 .br
121 [
122 .B \-R biod_reads
123 ] [
124 [
125 .B \-S symlink_cnt
126 ] [
127 .B \-t time
128 ] [
129 .B \-T
130 ]
131 .br
132 [
133 .B \-V
134 ] [
135 .B \-W biod_writes
136 ] [
137 .B \-w warmup_time
138 ] [
139 .B \-z
140 ]
141 .br
142 [
143 .B server:/directory ...
144 ]
145 .SH DESCRIPTION
146 Normally,
147 .B SFS
148 is executed via the
149 .B sfs_mgr
150 script which controls
151 .B SFS
152 execution on one or more
153 .SM NFS
154 client systems using a single user interface.
155 .P
156 .B SFS
157 is a Network File System server benchmark.
158 It runs on one or more 
159 .SM NFS
160 client machines to generate an artificial load
161 consisting of a particular mix of
162 .SM NFS
163 operations on a particular set of files
164 residing on the server being tested.
165 The benchmark reports the average response time of the
166 .SM NFS
167 requests in milliseconds for the requested target load.
168 The response time is the dependent variable.
169 Load can be generated for a specific amount of time,
170 or for a specific number of
171 .SM NFS
172 calls.
173 .P
174 .B SFS
175 can also be used to characterize server performance.
176 Nearly all of the major factors that influence NFS performance
177 can be controlled using
178 .B SFS
179 command line arguments. Normally however, only the
180 .B \-l load
181 option used.
182 Other commonly used options include the
183 .B \-t time
184 ,
185 .B \-p processes
186 ,
187 .B \-m mix_file
188 options.
189 The remaining options are used to adjust specific parameters that affect
190 .SM NFS
191 performance.
192 If these options are used, the results produced will be non\-standard,
193 and thus, will not be comparable to tests run with other option settings.
194 .P
195 Normally,
196 .B SFS
197 is used as a benchmark program to measure the
198 .SM NFS
199 performance
200 of a particular server machine at different load levels.
201 In this case,
202 the preferred measurement is to make a series of benchmark runs, 
203 varying the load factor for each run
204 in order to produce a performance/load curve.
205 Each point in the curve
206 represents the server's response time at a specific load.
207 .P
208 .B SFS
209 generates and transmits
210 .SM NFS
211 packets over the network to the server directly from the benchmark program,
212 without using the client's local NFS service.
213 This reduces the effect of the client NFS implementation on results,
214 and makes comparison of different servers more client-independent.
215 However, not all client implementation effects have been eliminated.
216 Since the benchmark does by-pass much of the client NFS implementation
217 (including operating system level data caching and write behind),
218 .B SFS
219 can only be used to measure server performance.
220 .P
221 Although
222 .B SFS
223 can be run between a single client and single server pair of machines,
224 a more accurate measure of server performance is obtained
225 by executing the benchmark on a number of clients simultaneously.
226 Not only does this present a more realistic model of
227 .SM NFS
228 usage, but also improves the chances that maximum performance
229 is limited by a lack of resources on the server machine,
230 rather than on a single client machine.
231 .P
232 In order to facilitate running
233 .B SFS
234 on a number of clients simultaneously,
235 an accompanying program called
236 .B sfs_mgr
237 provides a mechanism to run and synchronize the execution of multiple
238 instances of
239 .B SFS
240 spread across multiple clients and multiple networks
241 all generating load to the same
242 .SM NFS
243 server.
244 In general,
245 .B sfs_mgr
246 should be used to run both single- and multiple-client tests.
247 .P
248 .B SFS
249 employs a number of sub\-processes, each with its own test directory named
250 .B ./testdir<n>
251 (where <n> is a number from 0 to
252 .B processes
253 \- 1.)
254 A standard set of files is created in the test directory.
255 .P
256 If multiple
257 .B directories
258 are specified on the command line, the
259 .B SFS
260 processes will be evenly distributed among the directories.
261 This will produce a balanced load across each of the directories.
262 .P
263 The mix of
264 .SM NFS
265 operations generated can be set from a user defined mix file.
266 The format of the file consists of a simple format, the first
267 line contains the string "SFS MIXFILE VERSION 2" followed by
268 each line containing the operation name and the percentage (eg.
269 "write 12"). The total percentages must equal 100.
270 Operations with not specified will never be called by
271 .B SFS.
272 .SH SFS OPTIONS
273 .TP
274 .B \-a access_pcnt
275 The percentage of I/O files to access.
276 The access percent can be set from 0 to 100 percent.
277 The default is 10% access.
278 .TP
279 .B \-A append_pcnt
280 The percentage of write operations that append data to files
281 rather than overwriting existing data.
282 The append percent can be set from 0 to 100 percent.
283 The default is 70% append.
284 .TP
285 .B \-b blocksz_file
286 The name of a file containing a block transfer size distribution specification.
287 The format of the file and the default values are discussed below
288 under "Block Size Distribution".
289 .TP
290 .B \-B block_size
291 The maximum number of Kilo-bytes (KB) contained in any one data transfer block.
292 The valid range of values is from 1 to 8 KB.
293 The default maximum is 8 KB per transfer.
294 .TP
295 .B \-d debug_level
296 The debugging level, with higher values producing more debugging output.
297 When the benchmark is executed with debugging enabled,
298 the results are invalid.
299 The debug level must be greater than zero.
300 .TP
301 .B \-D dir_cnt
302 The number of files in each directory, the number of directories varies with
303 load load.
304 The default is 30 files per directory.
305 .TP
306 .B \-f file_set_delta
307 The percentage change in file set size.
308 The change percent can be set from 0 to 100 percent.
309 The default is 10% append.
310 .TP
311 .B \-F file_cnt
312 The number of files to be used for read and write operations.
313 The file count must be greater than 0.
314 The default is 100 files.
315 .TP
316 .B \-i
317 Run the test in interactive mode,
318 pausing for user input before starting the test.
319 The default setting is to run the test automatically.
320 .TP
321 .B \-l load
322 The number of NFS calls per second to generate from each client machine.
323 The load must be greater than the number of processes
324 (see the "\-p processes" option).
325 The default is to generate 60 calls/sec on each/client.
326 .TP
327 .B \-m mix_file
328 The name of a file containing the operation mix specification.
329 The format of the file and the default values are discussed below
330 under "Operation Mix".
331 .TP
332 .B \-p processes
333 The number of processes used to generate load on each client machine.
334 The number of processes must be greater than 0.
335 The default is 4 processes per client.
336 .TP
337 .B \-P
338 Populate the test directories and then exit; don't run the test.
339 This option can be used to examine the file set that the benchmark creates.
340 The default is to populate the test directories and then
341 execute the test automatically.
342 .TP
343 .B \-Q
344 Run NFS over TCP.
345 The default is UDP.
346 .TP
347 .B \-R biod_reads
348 The maximum number of asynchronus reads issued to simulate biod behavior.
349 The default is 2.
350 .TP
351 .B \-S symlink_cnt
352 The number of symbolic links to be used for symlink operations.
353 The symbolic link count must be greater than 0.
354 The default is 20 symlinks.
355 .TP
356 .B \-t time
357 The number of seconds to run the benchmark.
358 The number of seconds must be greater than 0.
359 The default is 300 seconds.
360 (Run times less than 300 seconds may produce invalid results.)
361 .TP
362 .B \-T op_num
363 Test a particular
364 .SM NFS
365 operation by executing it once.
366 The valid range of operations is from 1 to 23.
367 These values correspond to the procedure number
368 for each operation type as defined in the
369 .SM NFS
370 protocol specification.
371 The default is to run the benchmark, with no preliminary operation testing.
372 .TP
373 .B \-V
374 Validate the correctness of the server's
375 .SM NFS
376 implementation.
377 The option verifies the correctness of
378 .SM NFS
379 operations and data copies.
380 The verification takes place immediately before executing the test,
381 and does not affect the results reported by the test. 
382 The default is not to verify server
383 .SM NFS
384 operation before beginning the test.
385 .TP
386 .B \-z
387 Generate raw data dump of the individual data points
388 for the test run.
389 .TP
390 .B \-w warmup
391 The number of seconds to generate load before starting the timed test run.
392 The goal is to reach a steady state and eliminate any variable startup costs,
393 before beginning the test.
394 The warm up time must be greater than or equal to 0 seconds.
395 The default is a 60 second warmup period.
396 .TP
397 .B \-W biod_writes
398 The maximum number of asynchronus writes issued to simulate biod behavior.
399 The default is 2.
400 .SH MULTI-CLIENT OPTIONS
401 .B SFS
402 also recognizes options that are only used when executing a multi-client test.
403 These options are generated by
404 .B sfs_mgr
405 and should not be specified by an end-user.
406 .TP
407 .B \-M prime_client_hostname
408 The hostname of the client machine where a multi-client test
409 is being controlled from.
410 This machine is designated as the "prime client".
411 The prime client machine may also be executing the
412 .B SFS
413 load-generating code. There is no default value.
414 .TP
415 .B \-N client_num
416 The client machine's unique identifier within a multi-client test,
417 assigned by the
418 .B sfs_mgr
419 script.
420 There is no default value.
421 .\".TP
422 .\".B \-R random_number_seed
423 .\"The value used by the client to index into a table of random number seeds.
424 .\"There is no default value.
425 .SH OPERATION MIX
426 The
427 .B SFS
428 default mix of operations for version 2 is:
429 .sp
430 .TS
431 center;
432 l l l l l l
433 n n n n n n
434 l l l l l l
435 n n n n n n
436 l l l l l l
437 n n n n n n.
438 null    getattr setattr root    lookup  readlink
439 0%      26%     1%      0%      36%     7%
440 read    wrcache write   create  remove  rename
441 14%     7%      1%      1%      0%      0%
442 link    symlink mkdir   rmdir   readdir fsstat
443 0%      0%      0%      0%      6%      1%
444 .TE
445 .LP
446 The
447 .B SFS
448 default mix of operations for version 3 is:
449 .sp
450 .TS
451 center;
452 l l l l l l
453 n n n n n n
454 l l l l l l
455 n n n n n n
456 l l l l l l
457 n n n n n n
458 l l l l l l
459 n n n n n n.
460 null    getattr setattr lookup  access  readlink
461 0%      11%     1%      27%     7%      7%
462 read    write   create  mkdir   symlink mknod
463 18%     9%      1%      0%      0%      0%
464 remove  rmdir   rename  link    readdir readdirplus
465 1%      0%      0%      0%      2%      9%
466 fsstat  fsinfo  pathconf        commit
467 1%      0%      0%      5%
468 .TE
469 .P
470 The format of the file consists of a simple format, the first
471 line contains the string "SFS MIXFILE VERSION 2" followed by
472 each line containing the operation name and the percentage (eg.
473 "write 12"). The total percentages must equal 100.
474 .SH FILE SET
475 The default basic file set used by
476 .B SFS
477 consists of regular files varying in size from 1KB to 1MB used for read and
478 write operations,
479 and 20 symbolic links used for symbolic link operations.
480 In addition to these, a small number of regular files are created
481 and used for non-I/O operations (eg, getattr),
482 and a small number of regular, directory, and symlink files may
483 be added to this total due to creation operations (eg, mkdir).
484 .P
485 While these values can be controlled with command line options,
486 some file set configurations may produce invalid results.
487 If there are not enough files of a particular type,
488 the specified mix of operations will not be achieved.
489 Too many files of a particular type may produce
490 thrashing effects on the server.
491 .SH BLOCK SIZE DISTRIBUTION
492 The block transfer size distribution is specified by a table of values.
493 The first column gives the percent of operations that will be included in a
494 any particular specific block transfer.
495 The second column gives the number of blocks units that will be transferred.
496 Normally the block unit size is 8KB.
497 The third column is a boolean specifying
498 whether a trailing fragment block should be transferred.
499 The fragment size for each transfer is a random multiple of 1 KB,
500 up to the block size - 1 KB.
501 Two tables are used, one for read operation and one for write operations.
502 The following tables give the default distributions
503 for the read and write operations.
504 .sp
505 .TS
506 center;
507 c s s s
508 c s s s
509 r r r r
510 r r r r
511 c s s s
512 n n n r.
513 Read  - Default Block Transfer Size Distribution Table
514  
515                         resulting transfer
516 percent block count     fragment        (8KB block size)
517  
518 0       0       0        0%    0 -   7 KB
519 85      1       0       85%    8 -  15 KB
520 8       2       1        8%   16 -  23 KB
521 4       4       1        4%   32 -  39 KB
522 2       8       1        2%   64 -  71 KB
523 1       16      1        1%  128 - 135 KB
524 .TE
525 .sp 2
526 .TS
527 center;
528 c s s s
529 c s s s
530 r r r r
531 r r r r
532 c s s s
533 n n n r.
534 Write  - Default Block Transfer Size Distribution Table
535  
536                         resulting transfer
537 percent block count     fragment        (8KB block size)
538  
539 49      0       1       49%    0 -   7 KB
540 36      1       1       36%    8 -  15 KB
541 8       2       1        8%   16 -  23 KB
542 4       4       1        4%   32 -  39 KB
543 2       8       1        2%   64 -  71 KB
544 1       16      1        1%  128 - 135 KB
545 .TE
546 .P
547 A different distribution can be substituted by using the '-b' option.
548 The format for the block size distribution file consists of the first
549 three columns given above: percent, block count, and fragment.  Read
550 and write distribution tables are identified by the keywords "Read" and
551 "Write".  An example input file, using the default values, is given below:
552 .sp
553 .TS
554 l s s
555 n n n.
556 Read
557 0       0       0
558 85      1       0
559 8       2       1
560 4       4       1
561 2       8       1
562 1       16      1
563 .TE
564 .TS
565 l s s
566 n n n.
567 Write
568 49      0       1
569 36      1       1
570 8       2       1
571 4       4       1
572 2       8       1
573 1       16      1
574 .TE
575 .P
576 A second aspect of the benchmark controlled
577 by the block transfer size distribution table is the network data packet size.
578 The distribution tables define the relative proportion
579 of full block packets to fragment packets.
580 For instance, the default tables have been constructed
581 to produce a specific distribution of ethernet packet sizes
582 for i/o operations by controlling the amount of data in each packet.
583 The write packets produced consist of 50% 8-KB packets, and 50% 1-7 KB packets.
584 The read packets consist of 90% 8-KB packets, and 10% 1-7 KB packets.
585 These figures are determined by multiplying the percentage
586 of type of transfer times the number of blocks and fragments generated,
587 and adding the totals.
588 These computations are performed below
589 for the default block size distribution tables:
590 .sp
591 .TS
592 c c c c c
593 c c c c c
594 n n n n n
595 n n n n n
596 n n n n n
597 n n n n n
598 n n n n n
599 n n n n n
600 r r r l l
601 r r r n n
602 r r r l l.
603 Read                    total   total
604 percent blocks  fragments       blocks  fragments
605 0       0       0       0       0
606 85      1       0       85      0
607 8       2       1       16      8
608 4       4       1       16      4
609 2       8       1       16      2
610 1       16      1       16      1
611                         ----    -----
612                         149     15
613                          90%      10%
614 .TE
615 .sp 3
616 .TS
617 r r r r r
618 r r r r r
619 n n n n n
620 n n n n n
621 n n n n n
622 n n n n n
623 n n n n n
624 n n n n n
625 r r r l l
626 r r r n n
627 r r r l l.
628 Write                   total   total
629 percent blocks  fragments       blocks  fragments
630 49      0       1       0       49
631 36      1       1       36      36
632 8       2       1       16      8
633 4       4       1       16      4
634 2       8       1       16      2
635 1       16      1       16      1
636                         ----    ------
637                         100     100
638                          50%       50%
639 .TE
640 .SH USING SFS
641 As with all benchmarks,
642 .B SFS
643 can only provide numbers that are useful
644 if the test runs are set up carefully.
645 Since it measures server performance,
646 the client (or clients) should not limit throughput.
647 The goal is to determine how well the server performs.
648 Most tests involving a single client will be limited by the client's
649 ability to generate load, not by the server's ability to handle more load.
650 Whether this is the case can be determined by running the benchmark
651 at successively greater load levels and finding the "knee of the curve"
652 at which load level the response time begins to increase rapidly.
653 Having found the knee of the curve, measurements of CPU utilization,
654 disk i/o rates, and network utilization levels should be made in order
655 to determine whether the performance bottleneck is due to the client
656 or server.
657 .P
658 For the results reported by
659 .B SFS
660 to be meaningful, the tests should be run on an isolated network,
661 and both the client and server should be as quiescent as possible during tests.
662 .P
663 High error rates on either the client or server
664 can also cause delays due to retransmissions
665 of lost or damaged packets.
666 .B netstat(8)
667 can be used to measure the network error
668 and collision rates on the client and server.
669 Also
670 .B SFS
671 reports the number of timed-out
672 .SM RPC
673 calls that occur during the test as bad calls.
674 If the number of bad calls is too great,
675 or the specified mix of operations is not achieved,
676 .B SFS
677 reports that the test run is "Invalid".
678 In this case, the reported results should be examined 
679 to determine the cause of the errors.
680 .P
681 To best simulate the effects of
682 .SM NFS
683 clients on the server, the test
684 directories should be set up so that they are on at least two
685 disk partitions exported by the server.
686 .SM NFS
687 operations tend to randomize disk access,
688 so putting all of the
689 .B SFS
690 test directories on a single partition will not show realistic results.
691 .P
692 On all tests it is a good idea to run the tests repeatedly and compare results.
693 If the difference between runs is large,
694 the run time of the test should be increased
695 until the variance in milliseconds per call is acceptably small.
696 If increasing the length of time does not help,
697 there may be something wrong with the experimental setup.
698 .P
699 The numbers generated by
700 .B SFS
701 are only useful for comparison if the test setup on the client machine
702 is the same across different server configurations. 
703 Changing the
704 .B processes
705 or
706 .B mix
707 parameters will produce numbers that can not be meaningfully compared.
708 Changing the number of generator processes may affect the measured response
709 time due to context switching or other delays on the client machine,
710 while changing the mix of
711 .SM NFS
712 operations will change the whole nature of the experiment.
713 Other changes to the client configuration may also effect the comparability
714 of results.
715 .P
716 To do a comparison of different server configurations, first set up the
717 client test directory and do
718 .B SFS
719 runs at different loads to be sure that the variability is
720 reasonably low. Second, run
721 .B SFS
722 at different loads of interest and
723 save the results. Third, change the server configuration (for example,
724 add more memory, replace a disk controller, etc.). Finally, run the same
725 .B SFS
726 loads again and compare the results.
727 .SH SEE ALSO
728 .P
729 The benchmark 
730 .B README  
731 file contains many pointers to other
732 files which provide information concerning SFS.
733 .SH ERROR MESSAGES
734 .TP 10
735 .B "illegal load value"
736 The
737 .B load
738 argument following the
739 .B \-l
740 flag on the command line is not a positive number.
741 .TP
742 .B "illegal procs value"
743 The
744 .B processes
745 argument following the
746 .B \-p
747 flag on the command line is not a positive number.
748 .TP
749 .B "illegal time value"
750 The
751 .B time
752 argument following the
753 .B \-t
754 flag on the command line is not a positive number.
755 .TP
756 .B "bad mix file"
757 The
758 .B mix
759 file argument following the
760 .B \-m
761 flag on the command line could not be accessed.
762 .TP
763 .B "can't fork"
764 The parent couldn't fork the child processes. This usually results from
765 lack of resources, such as memory or swap space.
766 .TP
767 .PD 0
768 .B "can't open log file"
769 .TP
770 .B "can't stat log"
771 .TP
772 .B "can't truncate log"
773 .TP
774 .B "can't write sync file"
775 .TP
776 .B "can't write log"
777 .TP
778 .B "can't read log"
779 .PD
780 A problem occurred during the creation, truncation, reading or writing of the
781 synchronization log file. The parent process creates the
782 log file in /tmp and uses it to synchronize and communicate with its children.
783 .TP
784 .PD 0
785 .B "can't open test directory"
786 .TP
787 .B "can't create test directory"
788 .TP
789 .B "can't cd to test directory"
790 .TP
791 .B "wrong permissions on test dir"
792 .TP
793 .B "can't stat testfile"
794 .TP
795 .B "wrong permissions on testfile"
796 .TP
797 .B "can't create rename file"
798 .TP
799 .B "can't create subdir"
800 .PD
801 A child process had problems creating or checking the contents of its
802 test directory. This is usually due to a permission problem (for example
803 the test directory was created by a different user) or a full file system.
804 .TP
805 .PD 0
806 .B "op failed: "
807 One of the internal pseudo\-NFS operations failed. The name of the operation,
808 e.g. read, write, lookup, will be printed along with an indication of the
809 nature of the failure.
810 .TP
811 .B "select failed"
812 The select system call returned an unexpected error.
813 .SH BUGS
814 .P
815 .B SFS
816 can not be run on non\-NFS file systems.
817 .P
818 .P
819 Shell scripts that execute
820 .B SFS
821 must catch and ignore SIGUSR1, SIGUSR2, and SIGALRM, (see signal(3)).
822 These signals are used to synchronize the test processes.
823 If one of these signals is not caught,
824 the shell that is running the script will be killed.
825 .SH FILES
826 .PD 0
827 .TP
828 .B ./testdir*
829 per process test directory
830 .TP
831 .B /tmp/sfs_log%d
832 child process synchronization file
833 .TP
834 .B /tmp/sfs_CL%d
835 client log file
836 .TP
837 .B /tmp/sfs_PC_sync
838 prime client log file
839 .TP
840 .B /tmp/sfs_res
841 prime results log file
842 .PD