关于 redis连接数 和 redis性能 的关系
大家讲道理
大家讲道理 2017-04-27 09:02:13
[Redis讨论组]

一直对redis连接数redis性能的关系一知半解,我知道redis是单进程单线程,但是具体就不清楚了.
期间查了一些资料也没有找到想要的答案,希望能给一下详细的解释,或者给个链接也好

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

全部回复(3)
天蓬老师

redis内部采用epoll技术,即多路复用IO。对于连接数非常高的时候,有着更好的处理性能,而且redis是单线程的避免了上下文切换。

PHP中文网

Redis is single threaded. How can I exploit multiple CPU / cores?
It's very unlikely that CPU becomes your bottleneck with Redis, as usually Redis is either memory or network bound. For instance, using pipelining Redis running on an average Linux system can deliver even 500k requests per second, so if your application mainly uses O(N) or O(log(N)) commands, it is hardly going to use too much CPU.
However, to maximize CPU usage you can start multiple instances of Redis in the same box and treat them as different servers. At some point a single box may not be enough anyway, so if you want to use multiple CPUs you can start thinking of some way to shard earlier.
You can find more information about using multiple Redis instances in the Partitioning page.

FAQ

某草草

redis多个客户端会造成很大的IO开销,每个节点间交换数据没有Ehcache那么复杂,各有有缺点吧,哈哈

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号