Last active
January 9, 2020 10:29
-
-
Save zored/92fe74be3991f25299a04dacf26028f7 to your computer and use it in GitHub Desktop.
Linux RAM speed benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -ex | |
ram_dir=~/RAM_test | |
# Create directory and mount RAM-based filesystem: | |
mkdir $ram_dir | |
sudo mount tmpfs -t tmpfs $ram_dir | |
( | |
cd $ram_dir | |
dd if=/dev/zero of=data_tmp bs=1M count=512 # - write. | |
dd if=data_tmp of=/dev/null bs=1M count=512 # - read. | |
) || true | |
# Clean-up | |
umount $ram_dir | |
rm -rf $ram_dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment