Do long redis lock operations?

In Redis, some operations, such as SINTERSTORE , have

Time complexity: O (N * M) is the worst case, where N is the power of the smallest set and M is the number of sets.

In my use case, I expect to compare sets of 15,000 points each. The operation N * M on these sets will be O (30,000). The operation does not require time, that is, it does not matter to me how much time it will take. My question is whether my Redis will block during this calculation. Any ideas?

+6
source share
2 answers

The simple answer is โ€œYes,โ€ since Redis is based on a single multi-threaded architecture.

The difficult answer is โ€œit dependsโ€ - if you optimized your Redis, only the fragment performing this complex operation is blocked, other fragments are not.

+2
source

Redis is single threaded. It does not block anything, but it will not process any other commands until it ends. So, as if Radish was locked, and I think this is what you had in mind.

See also: Lock and delete

+1
source

Source: https://habr.com/ru/post/954533/


All Articles