单线程的redis为何会有如此好的性能
PHP中文网
PHP中文网 2017-04-21 11:17:04
0
2
602

通过阅读文档发现redis居然是单线程的,它是怎么做到能够支撑这么高的并发的?用到了什么特殊的算法结构或者非阻塞模型吗?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
大家讲道理

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.

迷茫

Search for: Redis single thread-multiplexed io model

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!