From f2dfc17315a816a41db61764669c6e07dd717b87 Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Wed, 3 Apr 2019 03:40:31 +0200 Subject: [PATCH] add ex1.1 --- ex1/main.tex | 54 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/ex1/main.tex b/ex1/main.tex index a277be4..82e8b8d 100644 --- a/ex1/main.tex +++ b/ex1/main.tex @@ -70,9 +70,57 @@ This is revision: \textbf{\gitAbbrevHash} Document (.tex) compiled on: \textbf{\ \begin{exercise}{I/O}{1} \begin{enumerate}[label=\alph*)] -\item Difficult Calculations. -\item Average time. -\item Many other tasks. +\item + Assumed sector size: 4kB \\ + Average Rotational Delay \\ + $ AvgRotDelay = 0.5 * rotations * rotationalSpeed $ \\ + $ 1000 rotations = 60000 ms $ \\ + $ 1 rotation = 6 ms $ \\ + Transfer Time \\ + $ TimeToRead = 8192 kB / 133120 kB * 1000 ms $ \\ + $ AvgSeekTime = 4 ms $ \\ + $ TransferTime = AvgSeekTime + AvgRotDelay + TimeToRead $ \\ + $ TransferTime = 4 ms + 3 ms + 0.06 ms $ \\ + $ TransferTime = 7.06 ms $ +\item Random Blocks: \\ + $ TotalTransferTime = 20 * TransferTime $ \\ + $ TotalTransferTime = 20 * 7.06 ms $ \\ + $ TotalTransferTime = 141.2 ms $ \\ + Consecutive Blocks: \\ + $ BytesToRead = 20 * 8 kB $ \\ + $ BytesToRead = 160 kB => 1 Track $ \\ + $ TotalTransferTime = 1 * TrackSeekTime + 1 * AvgRotDelay + 20 * TransferTime $ \\ + $ TotalTransferTime = 4 ms + 3 ms + 20 * 0.06 ms $ \\ + $ TotalTransferTime = 8.2 ms $ +\item Record size: \\ + $ RecordSize = 120 B + 8 B + 12 B + 4 B + 1 B = 145 B $ +\item Blocking Factor: \\ + $ MaximumRecordCountPerBlock = math.floor( 8192 kB / 8 kB ) $ \\ + $ MaximumRecordCountPerBlock = 56 $ \\ + $ NumberOfBlocks = math.ceil( NumRecords / MaximumRecordCountPerBlock ) $ \\ + $ NumberOfBlocks = 715 $ \\ + $ WastedBytesPerBlock = BlockSize - ( MaximumRecordCountPerBlock * RecordSize ) $ +\item Average Search Time: \\ + $ NumberOfTracks = math.ceil( NumberOfBlocks * BlockSize / AverageTrackSize ) $ \\ + $ NumberOfTracks = math.ceil( 11.17 ) $ \\ + $ NumberOfTracks = 12 $ \\ + $ SeqScanReadtime = (NumberOfBlocks * BlockSize) * 1000 ms / 133129 kB $ \\ + $ SeqScanReadtime = (715 * 8 kB) * 1000 ms / 133129 kB $ \\ + $ SeqScanReadtime = 5720 kB * 1000 ms / 133129 kB $ \\ + $ SeqScanReadtime = 42.969 ms $ \\ + $ AverageSearchTime = 1 * AvgSeekTime + 0.5 * ( NumberOfTracks * AvgRotDelay + (NumberOfTracks - 1) * TrackToTrackSeekTime + SeqScanReadTime ) $ \\ + $ AverageSearchTime = 4 ms + 0.5 * ( 12 * 3 ms + 11 * 0.2 ms + (715 * 8 kB) ) $ \\ + $ AverageSearchTime = 44.585 ms $ \\ + $ AverageNonContinuousSearchTime = NumberOfBlocks * TransferTime $ \\ + $ AverageNonContinuousSearchTime = 715 * 7.06 ms $ \\ + $ AverageNonContinuousSearchTime = 5047.9 ms $ +\item AverageNumberOfBlockAccess: \\ + $ AverageNumberOfBlockAccess = log(NumberOfBlocks) $ \\ + $ AverageNumberOfBlockAccess = log(715) $ \\ + $ AverageNumberOfBlockAccess = 6.572 $ \\ + Average Block Search Time: \\ + $ AverageBlockSearchTime = AverageNumberOfBlockAccess * 7.06 $ \\ + $ AverageBlockSearchTime = 46.40 ms $ \end{enumerate} \end{exercise} -- 2.43.0