通过阅读文档发现redis居然是单线程的,它是怎么做到能够支撑这么高的并发的?用到了什么特殊的算法结构或者非阻塞模型吗?
大家讲道理2017-04-21 11:19:04
Because Redis operations are very fast - all its data is in memory, and there is no need to access the disk at all. As for concurrency, Redis uses multi-channel I/O multiplexing technology, and its own concurrency efficiency is not a problem.
Of course, a single Redis process cannot use multiple cores (it can only run on one CPU core at any time), but it is not a very computationally intensive service. If the single-core performance is not enough, you can open several more processes.