Skip to content

Instantly share code, notes, and snippets.

@postazure
Created January 3, 2017 19:45
Show Gist options
  • Save postazure/d8d05c83fa6d7b2a274945d9057023dc to your computer and use it in GitHub Desktop.
Save postazure/d8d05c83fa6d7b2a274945d9057023dc to your computer and use it in GitHub Desktop.
Fill Redis Database with Junk
#!/usr/bin/env ruby
require "redis"
require "securerandom"
if ARGV.length != 4
puts "redis-filler.rb password url port mb"
exit 1
end
password = ARGV[0]
url = ARGV[1]
port = ARGV[2]
mb_to_load = ARGV[3].to_i
redis = Redis.new(:url => "redis://:#{password}@#{url}:#{port}")
mb_to_load.times do
1024.times do
redis.set("setby-script:#{SecureRandom.uuid}", SecureRandom.random_bytes(1024))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment