Skip to content

Commit bf7d9eb

Browse files
committed
Site updated: 2021-10-17 22:57:31
1 parent df3c5bd commit bf7d9eb

File tree

3 files changed

+13
-62
lines changed

3 files changed

+13
-62
lines changed

2021/10/17/限流/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<meta property="og:description" content="限流的作用限流定义:限制「速率」,或从业务层限制「总数」,被限流的请求,直接进入「降级」fallback 流程(fallback与业务相关); 使用场景: 应对突发流量,避免系统被压垮(全局限流和IP限流)。 防刷,防止机器人脚本等频繁调用服务(userID限流和IP限流) 对于应对突发流量避免系统压垮这个情景,可以在以下几方面做具体限流 业务系统入口(入流量),比如秒杀活动等系统做限流">
2929
<meta property="og:locale" content="zh_CN">
3030
<meta property="article:published_time" content="2021-10-17T06:10:18.000Z">
31-
<meta property="article:modified_time" content="2021-10-17T14:24:23.719Z">
31+
<meta property="article:modified_time" content="2021-10-17T14:56:05.803Z">
3232
<meta property="article:author" content="hustyong">
3333
<meta property="article:tag" content="技术">
3434
<meta property="article:tag" content="限流">
@@ -177,7 +177,7 @@ <h1 class="post-title" itemprop="name headline">
177177
<span class="post-meta-item-text">发表于</span>
178178

179179

180-
<time title="创建时间:2021-10-17 14:10:18 / 修改时间:22:24:23" itemprop="dateCreated datePublished" datetime="2021-10-17T14:10:18+08:00">2021-10-17</time>
180+
<time title="创建时间:2021-10-17 14:10:18 / 修改时间:22:56:05" itemprop="dateCreated datePublished" datetime="2021-10-17T14:10:18+08:00">2021-10-17</time>
181181
</span>
182182
<span class="post-meta-item">
183183
<span class="post-meta-item-icon">
@@ -220,6 +220,7 @@ <h1 id="限流的行为"><a href="#限流的行为" class="headerlink" title="
220220
<p>特权请求:资源不够了,我只能把有限的资源分给重要的用户</p>
221221
<p>延时处理:一般会有一个队列来缓冲大量的请求,这个队列如果满了,那么就只能拒绝用户了,如果这个队列中的任务超时了,也要返回系统繁忙的错误了</p>
222222
<p>弹性伸缩:用自动化运维的方式对相应的服务做自动化的伸缩</p>
223+
<span id="more"></span>
223224
<h1 id="单机-amp-分布式"><a href="#单机-amp-分布式" class="headerlink" title="单机&amp;分布式"></a>单机&amp;分布式</h1><p>本质上单机限流和分布式限流的区别其实就在于 “阈值” 存放的位置。单机限流就上面所说的算法直接在单台服务器上实现就好了,而往往我们的服务是集群部署的。因此需要多台机器协同提供限流功能。</p>
224225
<p>单节点限流<br>单实例限流,实现简单;依赖的资源如DB 无法被保护</p>
225226
<p>分布式限流<br>基于某种中间件(Redis)的限流方式,实现较复杂;但是能保护依赖资源不受流量冲击</p>

css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ pre .javascript .function {
11721172
}
11731173
.links-of-author a::before,
11741174
.links-of-author span.exturl::before {
1175-
background: #ff440b;
1175+
background: #98ff00;
11761176
border-radius: 50%;
11771177
content: ' ';
11781178
display: inline-block;

0 commit comments

Comments
 (0)