john smith
john smith

Reputation: 2163

Number of Redis queries

I have a script that runs 12-16 redis commands;

This might look like a dumb question but, considering that this script is usually called every couple of seconds, are they maybe too much to be executed all at once? I mean is Redis also designed to have such number of commands or should it be kept really as minimal as possible?

I am basically using LISTS for queues, SETS and strings.

Thanks in advance.

Upvotes: 0

Views: 873

Answers (1)

antirez
antirez

Reputation: 18514

With the numbers you posted there are no problems at all, Redis can handle this traffic without any issue unless those queries are intersections of big sets, or SORT, or other commands that have a run time proportional to number of elements in your type.

However it is not just a matter of Redis able to handle the traffic, you should also be concerned about latency. If you use pipelining (http://redis.io/topics/pipelining) you can ask multiple queries at once and avoid paying the round trip time multiple times.

Upvotes: 1

Related Questions