慕课网-一站式学习Redis从入门到高可用分布式实践-第2章-API的理解和使用-单线程

单线程

 

单线程为什么这么快?

1)纯内存

2)非阻塞IO

3)避免线程切换和竞态消耗

 

 

单线程需要注意什么?

1)一次只运行命令

2)拒绝长(慢)命令

keys、flushall、flushdb、show lua script、mutil/exec、operate big value(collection)

3)其实不是单线程

fysnc file descriptor

close file descriptor

 

posted on 2019-11-13 12:37  herisson_pan  阅读(7)  评论(0)    收藏  举报

导航