当前位置:网站首页>IO multiplexing of 09 redis
IO multiplexing of 09 redis
2022-04-23 06:06:00 【New ape and horse】
Catalog
One Redis Single thread or multi thread ?
Two Why single threaded Redis A high performance ?
3、 ... and What is? IO Multiplexing technology ?
One Redis Single thread or multi thread ?
This problem can be divided into two :
Redis A single thread , Because Redis Use the file event dispatcher to handle the event queue , And the file event dispatcher is single threaded , therefore Redis It's called a single threaded model .
Redis Is a multithreaded , Because persistence 、 Delete asynchronously 、 Cluster data synchronization and other operations are performed by threads other than data reading and writing threads , therefore Redis It can also be called multithreading model .
The reason why we all say it is single thread , Because it's single threaded Redis A high performance .
Two Why single threaded Redis A high performance ?
1 Redis All the data is stored in memory , Memory operation is fast .
2 Redis Use IO Multiplexing technology to deal with concurrent events .
This memory is easy to understand , Not much to say , Let's take a closer look at IO Multiplexing technology .
3、 ... and What is? IO Multiplexing technology ?
Pictured here Redis Overall event processing flow chart of client and server :

The flow chart is mainly composed of the following parts :
- multiple Socket.
- IO Multiplexing program .
- Event queue .
- File event dispatcher .
- Multi type event handler .
among IO Multiplexing program , Monitor multiple Socket.
With a Socket Examples of various event types .

1 Establish connection event
The client establishes a connection to the server ,IO After multiplexing listens to the request event for establishing a connection , Write the request event to the queue , The file event dispatcher gets the request event from the queue , Give it to the connection response processor for processing .
Connect the response processor with the client to create a Socket.
2 Write request event
The client sends one set key value Request ,IO After multiplexing listens to the write event , Write events to the queue , The file event dispatcher gets the request event from the queue , To the command request processor .
The command requests the processor to implement... In memory set key value The operation of .
3 Return result event
The client is ready to receive the results ,IO After multiplexer listens to the return result event , Write events to the queue , The file event dispatcher gets the request event from the queue , Give it to the command reply processor for processing .
The command reply processor returns the result .
版权声明
本文为[New ape and horse]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220533487924.html
边栏推荐
- 深入源码分析Servlet第一个程序
- In depth understanding of the relationship between dncblevel and noise denoising in the paper
- Opensips (1) -- detailed process of installing opensips
- Linear algebra Chapter 2 - matrices and their operations
- Remedy after postfix becomes a spam transit station
- JVM series (3) -- memory allocation and recycling strategy
- PyTorch笔记——观察DataLoader&用torch构建LeNet处理CIFAR-10完整代码
- Implementation of displaying database pictures to browser tables based on thymeleaf
- 无监督去噪——[TMI2022]ISCL: Interdependent Self-Cooperative Learning for Unpaired Image Denoising
- PyQt5学习(一):布局管理+信号和槽关联+菜单栏与工具栏+打包资源包
猜你喜欢

JVM series (3) -- memory allocation and recycling strategy

Software architecture design - software architecture style

Pytorch学习记录(七):处理数据和训练模型的技巧

自动控制(韩敏版)

Implementation of displaying database pictures to browser tables based on thymeleaf

CONDA virtual environment management (create, delete, clone, rename, export and import)

Pyqy5 learning (III): qlineedit + qtextedit

Pytorch學習記錄(十三):循環神經網絡((Recurrent Neural Network)

PyQy5学习(四):QAbstractButton+QRadioButton+QCheckBox

给yarn配置国内镜像加速器
随机推荐
The bottom implementation principle of thread - static agent mode
In depth source code analysis servlet first program
Programming record - picture rotation function SciPy ndimage. Simple use and effect observation of rotate()
Pytorch learning record (7): skills in processing data and training models
Anaconda
关于二叉树的遍历
EditorConfig
In depth understanding of the relationship between dncblevel and noise denoising in the paper
Pytorch学习记录(九):Pytorch中卷积神经网络
Pyqy5 learning (2): qmainwindow + QWidget + qlabel
Paper on LDCT image reconstruction: edge enhancement based transformer for medical image denoising
自動控制(韓敏版)
Pytorch notes - observe dataloader & build lenet with torch to process cifar-10 complete code
The official website of UMI yarn create @ umijs / UMI app reports an error: the syntax of file name, directory name or volume label is incorrect
深度学习基础——简单了解meta learning(来自李宏毅课程笔记)
对比学习论文——[MoCo,CVPR2020]Momentum Contrast for Unsupervised Visual Representation Learning
PyTorch笔记——通过搭建ResNet熟悉网络搭建方式(完整代码)
治療TensorFlow後遺症——簡單例子記錄torch.utils.data.dataset.Dataset重寫時的圖片維度問題
Pytorch introduction notes - use a simple example to observe the output size of each layer of forward propagation
Common programming records - parser = argparse ArgumentParser()