Testing Disk Read/Write Speed

Valued Contributor

The Goal
We have a number of Mid 2012 MacBook Pros still in production that have the known hard drive flex cable issue for which Apple has a Quality Program for replacement.

To better determine machines that need this cable replaced, I was trying to come up with a way to test the rough read and write speed of the internal drive on all our machines. Through some Google searching, I found a way to do this using dd. The commands I found for accomplishing this in MB/sec are below (http://www.amsys.co.uk/2013/04/using-command-line-to-benchmark-disks/):


WRITETEST=$(sync; dd if=/dev/zero bs=2048k of=/tmp/tstfile count=1024 2>&1 | awk '/sec/ {print $1 / $5 / 1048576}'; sync)
sudo purge 
READTEST=$(dd if=/tmp/tstfile bs=2048k of=/dev/null count=1024 2>&1 | awk '/sec/ {print $1 / $5 / 1048576}')
sudo purge

In my tests, this produced fairly accurate results when run from Terminal on a local computer compared to a GUI disk speed test tool like Black Magic Speed Test.

The Problem
I'm running into an issue I can't explain with regards to the read portion of the disk test. When I run in Terminal I get read speeds on a spinning disk drive between 40-55MB/sec. When I run the same commands via a JSS script I get significantly lower read speeds - between 20-30MB/sec..

I've tried splitting the read/write portions of the script into separate scripts and can confirm similar results on other Mid 2012 MacBook Pros

Can anyone help me think through why this would be happening? Hoping someone can enlighten me how the JSS distributes and runs scripts on endpoints.