Skip to content

Instantly share code, notes, and snippets.

@vbz-repo
Last active May 6, 2022 17:34
Show Gist options
  • Select an option

  • Save vbz-repo/a7dd8fd4ce4308226153dd81a6018137 to your computer and use it in GitHub Desktop.

Select an option

Save vbz-repo/a7dd8fd4ce4308226153dd81a6018137 to your computer and use it in GitHub Desktop.
Check the storage performance with "dd".

Check the cpu performance with "dd".

dd if=/dev/zero bs=1M count=1024 | md5sum
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.31041 s, 819 MB/s
cd573cfaace07e7949bc0c46028904ff  -

Check the storage performance with "dd".

1. Create a new directory on the disk device:

mkdir ddd
cd ddd

2. The writing test:

dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc status=progress
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.382968 s, 2.8 GB/s

3. Clear the buffer-cache:

sync && echo 3 | sudo tee /proc/sys/vm/drop_caches

4. The reading test:

dd if=tempfile of=/dev/null bs=1M count=1024 status=progress
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.36856 s, 2.9 GB/s

5. Repeat the last command to measure the read speed of the buffer-cache:

dd if=tempfile of=/dev/null bs=1M count=1024 status=progress
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.10554 s, 10.2 GB/s

6. Remove the directory and all its contents:

cd ..
rm -r ddd
ls -lha

Resources:

https://wiki.archlinux.org/title/Benchmarking#dd
https://romanrm.net/dd-benchmark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment