当前位置:网站首页>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
边栏推荐
- Gaussian processes of sklearn
- What is the difference between the basic feasible solution and the basic feasible solution in linear programming?
- 常用编程记录——parser = argparse.ArgumentParser()
- Postfix变成垃圾邮件中转站后的补救
- Multithreading and high concurrency (1) -- basic knowledge of threads (implementation, common methods, state)
- Pytorch Learning record (XIII): Recurrent Neural Network
- Numpy common function table sorting of data processing
- JDBC operation transaction
- 深入源码分析Servlet第一个程序
- Anaconda installed pyqt5 and pyqt5 tools without designer Exe problem solving
猜你喜欢
Opensips (1) -- detailed process of installing opensips
线性代数第三章-矩阵的初等变换与线性方程组
Configure domestic image accelerator for yarn
A general U-shaped transformer for image restoration
Pytorch notes - observe dataloader & build lenet with torch to process cifar-10 complete code
去噪论文阅读——[RIDNet, ICCV19]Real Image Denoising with Feature Attention
Manually delete registered services on Eureka
Ptorch learning record (XIII): recurrent neural network
实操—Nacos安装与配置
Pytorch learning record (III): structure of neural network + using sequential and module to define the model
随机推荐
数字图像处理基础(冈萨雷斯)一
Chapter 4 of line generation - linear correlation of vector systems
EditorConfig
Pyqy5 learning (2): qmainwindow + QWidget + qlabel
Gaussian processes of sklearn
Pytorch notes - complete code for linear regression & manual or automatic calculation of gradient code comparison
Pytoch -- data loading and processing
In depth source code analysis servlet first program
Graphic numpy array matrix
Programming record - picture rotation function SciPy ndimage. Simple use and effect observation of rotate()
Fundamentals of digital image processing (Gonzalez) II: gray transformation and spatial filtering
去噪论文阅读——[CVPR2022]Blind2Unblind: Self-Supervised Image Denoising with Visible Blind Spots
Contrôle automatique (version Han min)
Pytoch learning record (x): data preprocessing + batch normalization (BN)
Fundamentals of digital image processing (Gonzalez) I
Font shape `OMX/cmex/m/n‘ in size <10.53937> not available (Font) size <10.95> substituted.
去噪论文阅读——[RIDNet, ICCV19]Real Image Denoising with Feature Attention
Development environment EAS login license modification
interviewter:介绍一下MySQL日期函数
线性代数第三章-矩阵的初等变换与线性方程组