Skip to content

Instantly share code, notes, and snippets.

@badboy
Created January 12, 2015 16:34
Show Gist options
  • Save badboy/f54e0bb31ac07456f883 to your computer and use it in GitHub Desktop.
Save badboy/f54e0bb31ac07456f883 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" == "help" ]; then
echo "Usage: $0 [requests] [keyspacelen]"
echo
echo "requests - Total number of requests (default 1000000)"
echo "keyspacelen - Keyspace from which a random number will be chosen"
echo " (default 9999999)"
echo
echo "Wrapper around redis-benchmark to quickly fill a Redis instance with random data."
echo "The default values will result in about 100 MB data inserted."
exit
fi
requests=${1:-20000000}
keyspacelen=${2:-1000000000}
exec ~/code/redis/src/redis-benchmark -r $keyspacelen -n $requests -t set -P 32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment