redis 单线程

redis单线程为什么会这么快

  1. 纯内存
  2. 非阻塞IO
  3. 避免线程切换和竞态消耗

单线程要注意的问题 :

  1. 一次只执行一条命令
  2. 拒绝长命令 keys flushall,flushdb,slow lua script ,multi/exec,operate big value
  3. 其实不是单线程 fsync file descriptor ,close file descriptor

猜你喜欢

转载自blog.csdn.net/PYouLing123456789/article/details/83860288