Skip to content

Commit 5fa2660

Browse files
committed
限流
1 parent 3fd1c7e commit 5fa2660

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MD/分布式-限流.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
1. 漏桶算法
55
2. 令牌桶算法
6-
3.
6+
77
漏桶算法比较简单,就是将流量放入桶中,漏桶同时也按照一定的速率流出,如果流量过快的话就会溢出(漏桶并不会提高流出速率)。溢出的流量则直接丢弃。
88

99
如下图所示:
@@ -14,7 +14,7 @@
1414

1515
这时就需要用到令牌桶算法:令牌桶会以一个恒定的速率向固定容量大小桶中放入令牌,当有流量来时则取走一个或多个令牌。当桶中没有令牌则将当前请求丢弃或阻塞。
1616

17-
![](https://github.com/xbox1994/Java-Interview/raw/master/images/分布式-限流-1.png)
17+
![](https://github.com/xbox1994/Java-Interview/raw/master/images/分布式-限流-1.gif)
1818

1919
相比之下令牌桶可以应对一定的突发流量.
2020

0 commit comments

Comments
 (0)