Offloading Decision Calculator
Try Change Network bandwidth (MB/s) from 50 to 5.
Observe Watch Local processing time, Total offload time, and Verdict after pressing Calculate.
Explain Describe how the estimated 2/3 output affects Download time.
Calculate
Reset
Technical boundaries. Download time uses task size times 0.667. Total offload time adds upload, remote processing, and download time using the selected speeds.
viewof taskCpu = Inputs. range ([100 , 10000 ], {value : 3840 , step : 100 , label : "Task size (MB)" })
viewof localSpeed = Inputs. range ([1 , 50 ], {value : 12 , step : 1 , label : "Local speed (MB/s)" })
viewof surrogateSpeed = Inputs. range ([10 , 500 ], {value : 180 , step : 10 , label : "Surrogate speed (MB/s)" })
viewof netBandwidth = Inputs. range ([5 , 200 ], {value : 50 , step : 5 , label : "Network bandwidth (MB/s)" })
localTime = taskCpu / localSpeed
uploadTime = taskCpu / netBandwidth
remoteTime = taskCpu / surrogateSpeed
downloadTime = (taskCpu * 0.667 ) / netBandwidth
totalOffload = uploadTime + remoteTime + downloadTime
timeSavings = ((localTime - totalOffload) / localTime * 100 )
offloadBenefit = totalOffload < localTime
html `<div style="background: var(--bs-light, #f8f9fa); padding: 1rem; border-radius: 8px; border-left: 4px solid ${ offloadBenefit ? '#16A085' : '#E74C3C' } ; margin-top: 0.5rem;">
<p style="color: var(--bs-body-color); margin: 0;"><strong>Offloading Decision Calculator</strong></p>
<table style="width: 100%; margin-top: 0.5rem; color: var(--bs-body-color);">
<tr><th scope="row" style="font-weight: normal; text-align: left;">Local processing time:</th><td><strong> ${ localTime. toFixed (1 )} s</strong></td></tr>
<tr><th scope="row" style="font-weight: normal; text-align: left;">Upload time:</th><td><strong> ${ uploadTime. toFixed (1 )} s</strong></td></tr>
<tr><th scope="row" style="font-weight: normal; text-align: left;">Remote processing time:</th><td><strong> ${ remoteTime. toFixed (1 )} s</strong></td></tr>
<tr><th scope="row" style="font-weight: normal; text-align: left;">Download time (est. 2/3 output):</th><td><strong> ${ downloadTime. toFixed (1 )} s</strong></td></tr>
<tr><th scope="row" style="font-weight: normal; text-align: left;">Total offload time:</th><td><strong> ${ totalOffload. toFixed (1 )} s</strong></td></tr>
</table>
<p style="margin-top: 0.5rem; margin-bottom: 0; font-size: 1.1em; color: var(--bs-body-color);">
<strong>Verdict:</strong> ${ offloadBenefit ? 'Offload recommended -- saves ' + timeSavings. toFixed (1 ) + '% time' : 'Keep local -- offloading adds ' + Math . abs (timeSavings). toFixed (1 ) + '% overhead' }
</p>
</div>`
Back to the chapter