Redis API的使用和理解之单线程架构
2019-10-20 本文已影响0人
Change_6556
一个瞬间只执行一个命令
Redis为什么这么快
1.纯内存
2.非阻塞IO epoll IO多路复用
3.皮面线程切换和竞态消耗
单线程epoll模型
1.一次只运行一条命令 100ns
2.拒绝长命令
keys flushall,flushad,slow lua script,muti.exec,operate bing value (collection)
3.其实不是单线程
fysnc file descriptor
close file descriptor 会有独立的线程做