Answer the question
In order to leave comments, you need to log in
How does Redis work when accessed by multiple clients at the same time?
The first client (local) writes a string of 50 bytes to the radish list 20 times per second.
Let's say we got 200,000 lines = 10 megabytes
The second client tries to get the first 100,000 lines.
Transferring over the Internet will take some time.
What happens to the first client at this time?
Answer the question
In order to leave comments, you need to log in
As already mentioned - Redis is single-threaded, that is, requests will be executed in turn. Until it generates data for the second client, the request of the first one will not be executed. But it should be understood that the performance of Redis is very high. So much so that in the case of 2 clients, one of which writes something to the database 20 times per second, you simply will not notice the delay. The normal load for Redis is tens and hundreds of thousands of requests per second, or even millions.
Redis is single threaded. While the first request is being processed, it accepts requests from other clients and queues them for processing. Therefore, it is not recommended to perform KEYS * on a server with a million keys.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question