CPSC 310 HW 5, Summer 2008: Disk Technology and Performance Exercises, Assignments of Deductive Database Systems

A set of exercises from chapter 11 of a computer science course, cpsc 310, assigned during the summer of 2008. The exercises focus on understanding disk technology, performance, reliability, and implementation issues. They cover topics such as calculating disk capacity, seek time, rotational latency, block transfer time, and average seek time and rotational delay. The exercises also involve calculations for sorting a tuple relation r and determining the time to service requests using the 777 disk with elevator scheduling.

Typology: Assignments

Pre 2010

Uploaded on 02/10/2009

koofers-user-hjt-1
koofers-user-hjt-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CPSC 310 HW 5, Summer 2008, Ronnie Ward
Assigned 7/7/08, DUE in class on 7/15/08
Turn in a hardcopy with the Assignment Cover page and post your solutions to CSNet
These exercises were selected from Chapter 11, and one from SimpleDB to help you
better understand disk technology, performance, reliability and implementation issues.
1. 11.3.1 (a, c, d, e, f, g), and 11.3.2 (graduate students) p. 524
a.) 777 capacity? 512 bytes/sector*1000 sectors/trk*10,000 trks/surface*10 surfaces =
51GB
c.) Max seek time? 1+0.001*10,000 = 1 + 10 = 11 milliseconds
d.) Max rotational latency = one rotation, which is 1 trk r = 1/10,000 r/min*60
seconds/min = 0.006 seconds = 6 milliseconds
e.) Blk transfer time? Blk=16,384 bytes=32 sectors, 0.006ms/trk=0.000006 sec/sector =
0.006ms, which includes the 20% overhead for the gap. So transfer time for one blk is
32*0.006 = 0.192ms. Or using the book’s methodology, the number of degrees occupied
by a blk is 72*(31/100)+288*(32/1000)=11.448. Dividing this by 360 degrees and
multiplying by 6ms, we get 0.191ms to read a blk.
f.) Avg seek time? 1+0.001*10,000/3 ms, or 4.3ms
e.) Avg rotational delay? One-half 6ms, or 3ms
1) 11.3.2 (graduate students) p. 524 using the 747 disk
The sum of the first N integers is N*(N+1)/2. Starting at 2048, moving backwards an
average of (1+2+…+2047)/2048 is 1024 with 1/8th of that as an expected, or 128. Moving
forward average is (1+2+…+14336)/14336 is 7168 with a 7/8th probability implies an
expected value of 6272. Adding 128 and 6272, we get an expected average seek distance
of 6400, which is 1+0.001*6400, or 7.4ms. Adding the average blk access time of
(4.17+0.25)ms gives a total of 11.82ms.
2. 11.4.1 p. 532 using the 777 disk
Time to sort a 10,000,000 tuple relation R with a unique sort key? Blk size=16,384, and
100 records per blk with a record length of 160 bytes plus overhead.
So R is 10,000,000/100 blks, or 100,000 = 1.64GB.
There is 100MB of RAM available for sorting, implying 6400 blks can fit in RAM. The
first phase of a TPMMS with the disk in 11.3.1 is 200,000 blk I/Os, or
4.3ms+3ms+0.192ms = 7.5ms giving a 1st phase I/O time of 7.5*200,000 = 1498 seconds
= 25 minutes. The second phase takes the same number of I/Os, so the total sort time is
50 minutes.
3. 11.5.1 p. 544, but instead of the 747 disk, use the 777 disk described in exercise 11.3.1
At what time is each request fully serviced using the 777 disk where the heads are at trk
8000 initially? Avg seek, rotational delay, and transfer time of 4.3ms, 3ms, and 0.192ms
respectively. Assume each blk accessed takes 3ms+0.192ms, or 3.192ms, plus the seek
time (1+0.001n). Requests are 2000 at 0, 12000 at 1, 1000 at 10 and 10000 at 20.
pf2

Partial preview of the text

Download CPSC 310 HW 5, Summer 2008: Disk Technology and Performance Exercises and more Assignments Deductive Database Systems in PDF only on Docsity!

CPSC 310 HW 5, Summer 2008, Ronnie Ward Assigned 7/7/08, DUE in class on 7/15/ Turn in a hardcopy with the Assignment Cover page and post your solutions to CSNet

These exercises were selected from Chapter 11, and one from SimpleDB to help you better understand disk technology, performance, reliability and implementation issues.

  1. 11.3.1 (a, c, d, e, f, g), and 11.3.2 (graduate students) p. 524 a.) 777 capacity? 512 bytes/sector1000 sectors/trk10,000 trks/surface*10 surfaces = 51GB

c.) Max seek time? 1+0.001*10,000 = 1 + 10 = 11 milliseconds

d.) Max rotational latency = one rotation, which is 1 trk r = 1/10,000 r/min* seconds/min = 0.006 seconds = 6 milliseconds

e.) Blk transfer time? Blk=16,384 bytes=32 sectors, 0.006ms/trk=0.000006 sec/sector = 0.006ms, which includes the 20% overhead for the gap. So transfer time for one blk is 320.006 = 0.192ms. Or using the book’s methodology, the number of degrees occupied by a blk is 72(31/100)+288*(32/1000)=11.448. Dividing this by 360 degrees and multiplying by 6ms, we get 0.191ms to read a blk.

f.) Avg seek time? 1+0.001*10,000/3 ms, or 4.3ms

e.) Avg rotational delay? One-half 6ms, or 3ms

  1. 11.3.2 (graduate students) p. 524 using the 747 disk The sum of the first N integers is N(N+1)/2. Starting at 2048, moving backwards an average of (1+2+…+2047)/2048 is 1024 with 1/8th^ of that as an expected, or 128. Moving forward average is (1+2+…+14336)/14336 is 7168 with a 7/8th^ probability implies an expected value of 6272. Adding 128 and 6272, we get an expected average seek distance of 6400, which is 1+0.0016400, or 7.4ms. Adding the average blk access time of (4.17+0.25)ms gives a total of 11.82ms.
  1. 11.4.1 p. 532 using the 777 disk Time to sort a 10,000,000 tuple relation R with a unique sort key? Blk size=16,384, and 100 records per blk with a record length of 160 bytes plus overhead.

So R is 10,000,000/100 blks, or 100,000 = 1.64GB.

There is 100MB of RAM available for sorting, implying 6400 blks can fit in RAM. The first phase of a TPMMS with the disk in 11.3.1 is 200,000 blk I/Os, or 4.3ms+3ms+0.192ms = 7.5ms giving a 1st^ phase I/O time of 7.5*200,000 = 1498 seconds = 25 minutes. The second phase takes the same number of I/Os, so the total sort time is 50 minutes.

  1. 11.5.1 p. 544, but instead of the 747 disk, use the 777 disk described in exercise 11.3. At what time is each request fully serviced using the 777 disk where the heads are at trk 8000 initially? Avg seek, rotational delay, and transfer time of 4.3ms, 3ms, and 0.192ms respectively. Assume each blk accessed takes 3ms+0.192ms, or 3.192ms, plus the seek time (1+0.001n). Requests are 2000 at 0, 12000 at 1, 1000 at 10 and 10000 at 20.

CPSC 310 HW 5, Summer 2008, Ronnie Ward Assigned 7/7/08, DUE in class on 7/15/ Turn in a hardcopy with the Assignment Cover page and post your solutions to CSNet

Using Elevator scheduling, request 2000 is serviced at 1+ (8000-2000)* 0.001+3.192ms, or 10.192. 1000 is serviced next at time 10.192+ 1+(2000-1000)0.001+3.192ms, or 15.384. 10000 is serviced next at 15.384 + 1+(10000-1000)0.001+3.192, or 28.576. 12000 produces an error and is not serviced.

FCFS produces the same schedule if we assume 12000 results in an error and it not serviced.

  1. 11.7.5 p. 562 a.) 01010110 Disk 2 b) 11110000 11000000 Disk 3 11111000 10010110 00001000 00111011 Disk 4 00111111 10101101 00110111 11111011 ChkDisk 00000001 01010110 Disk 1 00110110
  2. Modily FileMgr() in SimpleDB to add code to track the total number of blocks read or written as private Java long data types, and return these to a calling program via accessor methods blockReads() and blockWrites(), which you write. Verify your changes are made correctly by modifying the TestFileMgr() code demonstrated in class. Answer this question: many block reads and writes are needed to create the studentdb database when the CreateStudentDB.java program is run? Turn in your modified TestFileMgr() and state any change you make to CreateStudentDB.java. See modified FileMgr() code attached. The total blocks read was: 196 and the total blocks written was: 219. I obtained these results by running the server StartUp under the debugger and fishing the totals out of FileMgr() static variable I added to StartUp (FileMgr fm = SimpleDB. fileMgr ();). I set a breakpoint in Startup.java at the System.out.println. At the breakpoint, in the view Variables panel menu, I selected show static variable of the local fm reference. Block_reads was 20 and block_writes was 38 after initialization. This was needed just to create the studentdb folder and the initial overhead files associated with a SimpleDB database. Then I ran CreateStudentDB. After it completed, I read the new totals for block_read and block_write, which were 196 and 219 respectively.