]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/doc/papers/diskperf/tests.ms
MFC r345816:
[FreeBSD/FreeBSD.git] / share / doc / papers / diskperf / tests.ms
1 .\" Copyright (c) 1983 The Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)tests.ms    6.2 (Berkeley) 4/16/91
29 .\" $FreeBSD$
30 .\"
31 .ds RH Tests
32 .NH
33 Tests
34 .PP
35 Our battery of tests consists of four programs,
36 read_8192, write_8192, write_4096
37 and rewrite_8192 originally written by [McKusick83]
38 to evaluate the performance of the new file system in 4.2BSD.
39 These programs all follow the same model and are typified by
40 read_8192 shown here.
41 .DS
42 #define BUFSIZ 8192
43 main( argc, argv)
44 char **argv;
45 {
46         char buf[BUFSIZ];
47         int i, j;
48
49         j = open(argv[1], 0);
50         for (i = 0; i < 1024; i++)
51                 read(j, buf, BUFSIZ);
52 }
53 .DE
54 The remaining programs are included in appendix A.
55 .PP
56 These programs read, write with two different blocking factors,
57 and rewrite logical files in structured file system on the disk
58 under test.
59 The write programs create new files while the rewrite program
60 overwrites an existing file.
61 Each of these programs represents an important segment of the
62 typical UNIX file system activity with the read program
63 representing by far the largest class and the rewrite the smallest.
64 .PP
65 A blocking factor of 8192 is used by all programs except write_4096.
66 This is typical of most 4.2BSD user programs since a standard set of
67 I/O support routines is commonly used and these routines buffer
68 data in similar block sizes.
69 .PP
70 For each test run, an empty eight Kilobyte block
71 file system was created in the target
72 storage system.
73 Then each of the four tests was run and timed.
74 Each test was run three times;
75 the first to clear out any useful data in the cache,
76 and the second two to insure that the experiment
77 had stablized and was repeatable.
78 Each test operated on eight Megabytes of data to
79 insure that the cache did not overly influence the results.
80 Another file system was then initialized using a
81 basic blocking factor of four Kilobytes and the same tests
82 were run again and timed.
83 A command script for a run appears as follows:
84 .DS
85 #!/bin/csh
86 set time=2
87 echo "8K/1K file system"
88 newfs /dev/rhp0g eagle
89 mount /dev/hp0g /mnt0
90 mkdir /mnt0/foo
91 echo "write_8192 /mnt0/foo/tst2"
92 rm -f /mnt0/foo/tst2
93 write_8192 /mnt0/foo/tst2
94 rm -f /mnt0/foo/tst2
95 write_8192 /mnt0/foo/tst2
96 rm -f /mnt0/foo/tst2
97 write_8192 /mnt0/foo/tst2
98 echo "read_8192 /mnt0/foo/tst2"
99 read_8192 /mnt0/foo/tst2
100 read_8192 /mnt0/foo/tst2
101 read_8192 /mnt0/foo/tst2
102 umount /dev/hp0g
103 .DE
104 .ds RH Results
105 .bp