From the redis docs: "The typical latency of a 1 GBits/s network is about 200 us, while the latency with a Unix domain socket can be as low as 30 us. "
It doesn't appear that URI can handle such a thing as: redis:///tmp/redis.sock
Here is a super ugly, quick and dirty, monkey patch to support it in em-hiredis. I humbly apologize for all of its overwhelming ugliness.
def self.setup(uri = nil)
if uri =~ /^redis:\/\/\//
url = URI(uri || ENV["REDIS_URL"] || "redis://127.0.0.1:6379/0")
Client.new(url.host, url.port, url.password, url.path[1..-1])
redis = EM::Hiredis.connect("redis:///tmp/redis.sock")
You have to add this to your redis server's conf:
If you clean this up I'm happy to accept a pull request :)
Now supported in master