|
|
|
Modern Operating Systems by Herbert Bos and Andrew S. Tanenb...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf
Showing 332-333 out of 1137
Modern Operating Systems by Herbert Bos and Andrew...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Modern Operating Systems by Herbert...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Page 332
SEC. 4.4
FILE-SYSTEM MANAGEMENT AND OPTIMIZATION
301
Length
VU 1984
VU 2005
Web
Length
VU 1984
VU 2005
Web
1
1.79
1.38
6.67
16 KB
92.53
78.92
86.79
2
1.88
1.53
7.67
32 KB
97.21
85.87
91.65
4
2.01
1.65
8.33
64 KB
99.18
90.84
94.80
8
2.31
1.80
11.30
128 KB
99.84
93.73
96.93
16
3.32
2.15
11.46
256 KB
99.96
96.12
98.48
32
5.13
3.15
12.33
512 KB
100.00
97.73
98.99
64
8.71
4.98
26.10
1 MB
100.00
98.87
99.62
128
14.73
8.03
28.49
2 MB
100.00
99.44
99.80
256
23.09
13.29
32.10
4 MB
100.00
99.71
99.87
512
34.44
20.62
39.94
8 MB
100.00
99.86
99.94
1 KB
48.05
30.91
47.82
16 MB
100.00
99.94
99.97
2 KB
60.87
46.09
59.44
32 MB
100.00
99.97
99.99
4 KB
75.31
59.13
70.64
64 MB
100.00
99.99
99.99
8 KB
84.97
69.96
79.69
128 MB
100.00
99.99
100.00
Figure 4-20.
Percentage of files smaller than a given size (in bytes).
large files (videos) and the total amount of space taken up by the small files hardly
matters at all. Even doubling the space the smallest 90% of the files take up would
be barely noticeable.
On the other hand, using a small block means that each file will consist of
many blocks. Reading each block normally requires a seek and a rotational delay
(except on a solid-state disk), so reading a file consisting of many small blocks will
be slow.
As an example, consider a disk with 1 MB per track, a rotation time of 8.33
msec, and an average seek time of 5 msec. The time in milliseconds to read a block
of
k
bytes is then the sum of the seek, rotational delay, and transfer times:
5
+
4. 165
+
(
k
/1000000)
×
8. 33
The dashed curve of Fig. 4-21 shows the data rate for such a disk as a function of
block size.
To compute the space efficiency, we need to make an assumption about
the mean file size. For simplicity, let us assume that all files are 4 KB.
Although
this number is slightly larger than the data measured at the VU, students probably
have more small files than would be present in a corporate data center, so it might
be a better guess on the whole. The solid curve of Fig. 4-21 shows the space ef-
ficiency as a function of block size.
The two curves can be understood as follows. The access time for a block is
completely dominated by the seek time and rotational delay, so given that it is
going to cost 9 msec to access a block, the more data that are fetched, the better.
Page 333
302
FILE SYSTEMS
CHAP. 4
1 KB
4 KB
16 KB
64 KB
256 KB
1MB
100%
10
20
30
40
50
60
0
80%
60%
40%
20%
0%
Data rate (MB/sec)
Disk space utilization
Figure 4-21.
The dashed curve (left-hand scale) gives the data rate of a disk. The
solid curve (right-hand scale) gives the disk-space efficiency. All files are 4 KB.
Hence the data rate goes up almost linearly with block size (until the transfers take
so long that the transfer time begins to matter).
Now consider space efficiency. With 4-KB files and 1-KB, 2-KB, or 4-KB
blocks, files use 4, 2, and 1 block, respectively, with no wastage. With an 8-KB
block and 4-KB files, the space efficiency drops to 50%, and with a 16-KB block it
is down to 25%.
In reality, few files are an exact multiple of the disk block size, so
some space is always wasted in the last block of a file.
What the curves show, however, isthat performance and space utilization are
inherently in conflict. Small blocks are bad for performance but good for disk-
space utilization.
For these data, no reasonable compromise is available. The size
closest to where the two curves cross is 64 KB, but the data rate is only 6.6 MB/sec
and the space efficiency is about 7%, neither of which is very good. Historically,
file systems have chosen sizes in the 1-KB to 4-KB range, but with disks now
exceeding 1 TB, it might be better to increase the block size to 64 KB and accept
the wasted disk space. Disk space is hardly in short supply any more.
In an experiment to see if Windows NT file usage was appreciably different
from UNIX file usage, Vogels made measurements on files at Cornell University
(Vogels, 1999).
He observed that NT file usage is more complicated than on
UNIX. He wrote:
When we type a few characters in the
Notepad
text editor, saving this to a
file will trigger 26 system calls, including 3 failed open attempts, 1 file
overwrite and 4 additional open and close sequences.
Nevertheless, Vogels observed a median size (weighted by usage) of files just read
as 1 KB, files just written as 2.3 KB, and files read and written as 4.2 KB.
Given
the different data sets measurement techniques, and the year, these results are cer-
tainly compatible with the VU results.
Ace your assessments! Get Better Grades
Browse thousands of Study Materials & Solutions from your Favorite Schools
Concordia University
Concordia_University
School:
Operating_Systems
Course:
Introducing Study Plan
Using AI Tools to Help you understand and remember your course concepts better and faster than any other resource.
Find the best videos to learn every concept in that course from Youtube and Tiktok without searching.
Save All Relavent Videos & Materials and access anytime and anywhere
Prepare Smart and Guarantee better grades
Students also viewed documents
lab 18.docx
lab_18.docx
Course
Course
3
Module5QuizSTA2023.d...
Module5QuizSTA2023.docx.docx
Course
Course
10
Week 7 Test Math302....
Week_7_Test_Math302.docx.docx
Course
Course
30
Chapter 1 Assigment ...
Chapter_1_Assigment_Questions.docx.docx
Course
Course
5
Week 4 tests.docx.do...
Week_4_tests.docx.docx
Course
Course
23
Week 6 tests.docx.do...
Week_6_tests.docx.docx
Course
Course
106