What single threaded 1.redis is a single thread?
Only one client connection is processed at the same point in time, which is a single thread of the Redis network module.
Why 2.redis is designed as a single thread
Specific author How to think that I don't know I say I understand
(1) Non-blocking IO for Redis, nonblocking I/O can be a single-threaded process for multiple requests
(2) If using multithreading, it is necessary to consider the context of the thread switch, and lock request and release, these operations are also more time-consuming, lock waiting more easily to the business thread pool full
(3) In my opinion, the design concept of Redis is fast track approach, in the case of full memory calculation, can serial, in processing socket request this block uses non-blocking IO, and is pure memory operation, an event loop (Request event) down, almost no waiting point
3.redis is a single thread why so fast
(1) Pure memory operation
(2) Asynchronous non-blocking I/O
(3) Single thread, avoids context switch and lock
4. Three major killers of service energy
(1) Thread switching overhead caused by a large number of threads
(2) Request and release lock
(3) Non-essential memory copy
Redis Single Thread Issues