个人简介

Echo Blog


江湖无名 安心练剑
  • Redis Learn-15-02-频道的订阅与退订
    频道的订阅与退订 当一个客户端执行 SUBSCRIBE 命令, 订阅某个或某些频道的时候, 这个客户端与被订阅频道之间就建立起了一种订阅关系。 Redis 将所有频道的订阅关系都保存在服务器状态的 pubsub_channels 字典里面, 这个字典的键是某个被订阅的频道, 而键的值则是一个链表, 链表里面记录了所有订阅这个频道的客户端: struct redisServer { ...
    2018-12-12 03:35:23 | Redis
  • Redis Learn-15-Pub/Sub 发布订阅
    Pub/Sub SUBSCRIBE, UNSUBSCRIBE and PUBLISH implement the Publish/Subscribe messaging paradigm(范例) where (citing Wikipedia) senders (publishers) are not programmed to send their messages to specifi...
    2018-12-12 03:35:23 | Redis
  • Redis Learn-14-Pipeline 使用泳道提升速度
    Request/Response protocols and RTT Redis is a TCP server using the client-server model and what is called a Request/Response protocol. 请求流程 This means that usually a request is accomplished(完成) ...
    2018-12-12 03:35:23 | Redis
  • Redis Learn-13-Monitor 监视器
    监视器 通过执行 MONITOR 命令, 客户端可以将自己变为一个监视器, 实时地接收并打印出服务器当前处理的命令请求的相关信息: redis> MONITOR OK 1378822099.421623 [0 127.0.0.1:56604] "PING" 1378822105.089572 [0 127.0.0.1:56604] "SET" "msg" "hello world"...
    2018-12-12 03:35:23 | Redis
  • Redis Learn-12-慢日志 slow log
    慢日志 Redis 的慢查询日志功能用于记录执行时间超过给定时长的命令请求, 用户可以通过这个功能产生的日志来监视和优化查询速度。 配置选项 服务器配置有两个和慢查询日志相关的选项: slowlog-log-slower-than 选项指定执行时间超过多少微秒(1 秒等于 1,000,000 微秒)的命令请求会被记录到日志上。 举个例子, 如果这个选项的值为 100 , 那么执行时...
    2018-12-12 03:35:23 | Redis
  • Redis Learn-12-latency
    慢操作的定位 在定位慢操作的时候,我们经常根据 slowlog 去定位 但是一个执行操作,如果是等待的时间过长,slowlog 是不进行记录的。 slowlog 仅仅记录动作的执行时间。 latency 就是为了解决这个问题而生的。 Redis latency monitoring framework Redis is often used in the context of d...
    2018-12-12 03:35:23 | Redis
  • Redis Learn-11-03-初始化服务器
    初始化服务器 Redis服务器初始化可以分为六个步骤: 初始化服务器全局状态。 载入配置文件。 创建 daemon 进程。 初始化服务器功能模块。 载入数据。 开始事件循环。 初始化服务器全局状态 redis.h/redisServer 结构记录了和服务器相关的...
    2018-12-12 03:35:23 | Redis
  • Redis Learn-11-02-ServerCron
    serverCron 简介 在 Redis 中, 常规操作由 redis.c/serverCron 实现, 它主要执行以下操作 serverCron函数每100毫秒执行一次,负责管理服务器资源,并保持服务器自身的良好运转。 /* This is our timer interrupt, called server.hz times per second. * Here is wher...
    2018-12-12 03:35:23 | Redis