过去, Paxos一直是分布式协议的标准,但是Paxos难于理解,更难以实现,Google的分布式锁系统Chubby作为Paxos实现曾经遭遇到很多坑。
More Redis internals: Tracing a GET & SET
MARCH 10, 2011
In my previous article, I took a superficial look at how Redis starts up and prepares itself to process commands. In this article, I’ll follow a GET
and a SET
command as they move from client through the server and back. The GET
will be for a key that doesn’t exist, and the SET
will set that key. Then I’ll look quickly at a subsequent GET
and how it differs.
under the hood
by Paul Smith (@paulsmith)
How does the Redis server work?
I was curious to learn more about Redis’s internals, so I’ve been familiarizing myself with the source, largely by reading and jumping around in Emacs. After I had peeled back enough of the onion’s layers, I realized I was trying to keep track of too many details in my head, and it wasn’t clear how it all hung together. I decided to write out in narrative form how an instance of the Redis server starts up and initializes itself, and how it handles the request/response cycle with a client, as a way of explaining it to myself, hopefully in a clear fashion. Luckily, Redis has a nice, clean code base that is easy to read and follow along. Armed with a TAGS file, my $EDITOR
, and GDB, I set out to see how it all works under the hood. (Incidentally, I was working with the Redis code base as of commit b4f2e41. Of course, internals such as I outline below are subject to change. However, the broad architecture of the server is unlikely to change very much, and I tried to keep that in mind as I went along.)
深入理解Linux IO模型(二)
深入理解Linux IO模型(二)
原创 Pearl Pearl的仲夏夜之梦 6月13日
为何使用epollselect的缺陷epoll的提出epoll的原理数据结构实现原理高效原因epoll的API创建epoll控制epoll等待epoll使用epoll API触发方式水平触发(Level Triggered, LT)边缘触发(Edge Triggered, ET)两者对比Reference
深入理解Linux IO模型(一)
深入理解Linux IO模型(一)
原创 Pearl Pearl的仲夏夜之梦 6月12日
Linux IO模型是后端工程师的必备技能。从以往的面试中看,部分后端开发人员对它的理解停留在调API的层面,我自己也理解欠缺。最近系统学习了一下,整理了此文。本文参考了一些文章,放在本文最后,大家可以直接去看这些文章,值得阅读。
Redis的47连环炮,试试你能看住几个 -面前复习
写在前面
大家好,我是老田,前面我们已经分享了五篇连环炮文章,今天我们继续。今天我们接着来聊聊Redis。Redis已经成为我们开发者必备技能之一了,同时面试也是必问的。下面就来对Redis进行一个总结,然后赠送43连环炮。
redis基础数据结构skiplist
太长不看版
- 跳跃表是有序集合的底层实现之一, 除此之外它在 Redis 中没有其他应用。
- 每个跳跃表节点的层高都是 1 至 64 之间的随机数
- 层高越高出现的概率越低,层高为i的概率为( 1 − p ) ∗ p i − 1 , ( p = 1 / 4 ) (1-p) * p^{i-1}, (p=1/4)(1−p)∗p**i−1,(p=1/4)。
- 跳跃表中,分值可以重复, 但对象成员唯一。分值相同时,节点按照成员对象的大小进行排序。
本篇解析基于redis 5.0.0版本,本篇涉及源码文件为t_zset.c, server.h。
操作系统基础56-磁盘调度算法
操作系统基础56-磁盘调度算法
2021-02-08 02:15·重学IT的老猫
操作系统的职责之一是有效使用硬件。对于磁盘驱动器,满足这个要求具有较快的访问速度和较宽的磁盘带宽。 对于磁盘,访问时间包括两个主要部分: