当前位置:网站首页>[network communication -- webrtc] analysis of webrtc source code -- supplement of pacingcontroller related knowledge points
[network communication -- webrtc] analysis of webrtc source code -- supplement of pacingcontroller related knowledge points
2022-06-23 17:06:00 【Struggle Penguin coppersun】
【 Network communication -- WebRTC】WebRTC Source code analysis -- PacingController Relevant knowledge points supplement
【1】 Introduction to leaky bucket current limiting algorithm
Leaky bucket algorithm (Leaky Bucket) Network traffic shaping (Traffic Shaping) Or speed limit (Rate Limiting) An algorithm often used when , Its main purpose is to control the rate of data injection into the network , Smooth the burst traffic on the network ;
As shown in the figure , Compare the request to water , When the water comes, put it in the bucket first , And at a limited rate , When the water comes too fast and the water doesn't come out fast enough, it will cause the water to overflow directly , Denial of service ;
Leaky bucket current limiting algorithm -- Main attribute fields
- 1. The rate at which requests are processed (rate), This value represents how often a request is processed
- 2. The maximum capacity of the barrel (capacity), This value represents the maximum number of requests allowed to queue
- 3. The time when the last queued request in the bucket is processed (last)
- 1) When a new request comes in , You can calculate how long a new request needs to be processed ,last + rate
- 2) according to last、 current time (t) And speed (rate) Calculate how many requests are currently waiting to be processed ,waitRequests = (last - t) / rate
Leaky bucket current limiting algorithm -- How to calculate the actual processing time of the request
- 1. Calculate the interval between the current time and the last processed time
- 2. And rate Compare , Calculation and rate The difference between the , Then complete the difference
delta = current time (t) - last
last = current time (t) + (rate - delta)Leaky bucket current limiting algorithm -- " bucket " Full judgment method
- According to the current time (t), And the time when the last request queued in the bucket is processed (last) Difference between , Then divide by the rate (rate), Calculate the number of requests waiting to be processed , Then with the maximum capacity of the barrel (capacity) Just compare
Reference and thanks
This blog is a study note for bloggers , At the same time, I refer to the blogs of online bloggers and relevant professional books , Thank you , If there are deficiencies in this paper , Please criticize and correct me .
【1】 Graphic leaky bucket (LeakyBucket) Implementation principle of current limiter
【2】 Interface current limiting algorithm : Leaky bucket algorithm & Token bucket algorithm
【3】 Current limiting —— The difference between leaky bucket algorithm and token bucket algorithm
边栏推荐
- 以 27K 成功入职字节跳动,这份《 软件测试面试笔记》让我受益终身
- Apache foundation officially announced Apache inlong as a top-level project
- Lamp architecture that your girlfriend can read
- Golang write file code example
- 【网络通信 -- WebRTC】WebRTC 源码分析 -- PacingController 相关知识点补充
- JS常见的报错及异常捕获
- Comparison of asemi Schottky diode and ultrafast recovery diode in switching power supply
- 你的PCB地线走的对吗?为什么要有主地?
- Freemark uses FTL files to generate word
- Taishan Office Technology Lecture: four cases of using Italic Font
猜你喜欢

Rongyun: let the bank go to the "cloud" easily
![Leetcode: question d'entrevue 08.13. Empiler la boîte [DFS en haut + mémoire ou tri en bas + DP]](/img/22/220e802da7543c2b14b7057e4458b7.png)
Leetcode: question d'entrevue 08.13. Empiler la boîte [DFS en haut + mémoire ou tri en bas + DP]

官方零基础入门 Jetpack Compose 的中文课程来啦!

NPM install problem solving (NVM installation and use)

JS common error reporting and exception capture

The company recruited a tester with five years' experience and saw the real test ceiling

Here comes the official zero foundation introduction jetpack compose Chinese course!

Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)

Can the asemi fast recovery diodes RS1M, us1m and US1G be replaced with each other

Practice sharing of chaos engineering in stability management of cloud native Middleware
随机推荐
Counter attack by flour dregs: MySQL 66 question! Suggested collection
【网络通信 -- WebRTC】WebRTC 源码分析 -- 接收端带宽估计
ELK日志收集系统部署
Is it cost-effective to buy a long-term financial product?
Intel arc A380 graphics card message summary: the entry-level price products of running point and bright driving need to be optimized
[solution] NPM warn config global ` --global`, `--local` are deprecated Use `--location=global`
如何选择示波器?这10点一定要考虑!
Is your PCB ground wire right? Why should we have a master land?
R language ggplot2 visualizes horizontal boxplot with coord_flip, and adds jittered data points to display the distribution
Reading and writing JSON files by golang
Golang write file code example
OutputDebugString instructions and exception handling
电感参数有哪些?怎么选择电感?
Now I want to buy stocks. How do I open an account? Is it safe to open a mobile account?
Robot Orientation and some misunderstandings in major selection in college entrance examination
The Google play academy team PK competition is in full swing!
Implementation of golang bubble sort code
Leetcode: interview question 08.13 Stacking bin [top-down DFS + memory or bottom-up sorting + DP]
Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)
Importance and purpose of test