Skip to content

Instantly share code, notes, and snippets.

@okanon
Created January 31, 2019 01:03
Show Gist options
  • Save okanon/b941cebb3655b2659438c013d00205cf to your computer and use it in GitHub Desktop.
Save okanon/b941cebb3655b2659438c013d00205cf to your computer and use it in GitHub Desktop.
What is the optimal buffering size?
#!/bin/bash
echo "creating file to work with"
dd if=/dev/zero of=/var/tmp/bsopt count=1145140
for buff in 1M 2M 4M 8M 16M 32M 64M 128M 256M
do
echo "---------------------------------------"
echo "Testing block size = $buff"
dd if=/var/tmp/bsopt of=/var/tmp/obsopt bs=$buff
echo
done
echo "success :)"
echo $t
rm /var/tmp/bsopt /var/tmp/obsopt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment