Skip to content

Instantly share code, notes, and snippets.

@antirez
Created June 20, 2014 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antirez/02953dbde8a05ea8d9aa to your computer and use it in GitHub Desktop.
Save antirez/02953dbde8a05ea8d9aa to your computer and use it in GitHub Desktop.
$LOAD_PATH.unshift("./lib")
require './lib/redis.rb'
Sentinels = [{:host => "127.0.0.1", :port => 26380},
{:host => "127.0.0.1", :port => 26381}]
r = Redis.new(:url => "sentinel://mymaster", :sentinels => Sentinels, :role => :master)
r.ping
(0..1000000).each{|i|
begin
r.set(i,i)
puts i
rescue
puts "ERROR #{i}"
end
sleep(0.01)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment