Reputation: 593
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?
Upvotes: 3
Views: 2253
Reputation: 1062770
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.
Upvotes: 3