3

I need get about 10k hashes from redis server. Since there is no command to get multiple hashes in redis I was iterating through the all keys using db.HashGetAllAsync() call and then waiting all tasks to complete. Even though it worked I saw a dramatic latency spike on RedisLabs dashboard during these calls.

Is there any ways to get many hashes at the same time? Maybe there is any ConnectionMultiplexer settings that may help in this situation?

1
  • Are you running multiple invocations of this call, then awaiting all of the results to be returned? If so, how many concurrent connections are you running? Commented Mar 18, 2015 at 0:32

1 Answer 1

3

There is no varadic hgetall, so yes: the simplest approach would be to pipeline a huge number of individual hgetall. The only other thing you could even possibly do would be to use a Lua script (eval/evalsha) to generate multiple items in each item, but I can't see how this would reduce server load or bandwidth any, so it doesn't seem to be worth trying!

Either way, yes: this will generate some work on the server.

Sign up to request clarification or add additional context in comments.

2 Comments

I guess using Lua script in situation where I'm trying to get 10k hashes would put other redis calls to queue and increase latency even more.
@pauliusnrk yep, I'd guess so too; your best bet here, IMO, would be to do the bulk hash read from a slave

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.