mirror of https://github.com/istio/istio.io.git
246 lines
5.7 KiB
HTML
246 lines
5.7 KiB
HTML
---
|
|
WARNING: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT. PLEASE MODIFY THE ORIGINAL SOURCE IN THE 'https://github.com/istio/istio' REPO
|
|
source_repo: https://github.com/istio/istio
|
|
title: Redis Quota
|
|
description: Adapter for a Redis-based quota management system.
|
|
location: https://istio.io/docs/reference/config/policy-and-telemetry/adapters/redisquota.html
|
|
layout: protoc-gen-docs
|
|
generator: protoc-gen-docs
|
|
supported_templates: quota
|
|
aliases:
|
|
- /docs/reference/config/adapters/redisquota.html
|
|
number_of_entries: 4
|
|
---
|
|
<p>The <code>redisquota</code> adapter can be used to support Istio’s quota management
|
|
system. It depends on a Redis server to store quota values.</p>
|
|
|
|
<p>This adapter supports the <a href="/docs/reference/config/policy-and-telemetry/templates/quota/">quota template</a>.</p>
|
|
|
|
<h2 id="Params">Params</h2>
|
|
<section>
|
|
<p>redisquota adapter supports the rate limit quota using either fixed or
|
|
rolling window algorithm. And it is using Redis as a shared data storage.</p>
|
|
|
|
<p>Example configuration:</p>
|
|
|
|
<pre><code class="language-yaml">redisServerUrl: localhost:6379
|
|
connectionPoolSize: 10
|
|
quotas:
|
|
- name: requestcount.quota.istio-system
|
|
maxAmount: 50
|
|
validDuration: 60s
|
|
bucketDuration: 1s
|
|
rateLimitAlgorithm: ROLLING_WINDOW
|
|
overrides:
|
|
- dimensions:
|
|
destination: ratings
|
|
source: reviews
|
|
maxAmount: 12
|
|
- dimensions:
|
|
destination: reviews
|
|
maxAmount: 5
|
|
</code></pre>
|
|
|
|
<table class="message-fields">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Required</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="Params-quotas">
|
|
<td><code>quotas</code></td>
|
|
<td><code><a href="#Params-Quota">Params.Quota[]</a></code></td>
|
|
<td>
|
|
<p>The set of known quotas. At least one quota configuration is required</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="Params-redis_server_url">
|
|
<td><code>redisServerUrl</code></td>
|
|
<td><code>string</code></td>
|
|
<td>
|
|
<p>Redis connection string <code><hostname>:<port number></code>
|
|
ex) localhost:6379</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="Params-connection_pool_size">
|
|
<td><code>connectionPoolSize</code></td>
|
|
<td><code>int64</code></td>
|
|
<td>
|
|
<p>Maximum number of idle connections to redis
|
|
Default is 10 connections per every CPU as reported by runtime.NumCPU.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<h2 id="Params-Override">Params.Override</h2>
|
|
<section>
|
|
<table class="message-fields">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Required</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="Params-Override-dimensions">
|
|
<td><code>dimensions</code></td>
|
|
<td><code>map<string, string></code></td>
|
|
<td>
|
|
<p>The specific dimensions for which this override applies.
|
|
String representation of instance dimensions is used to check against configured dimensions.
|
|
<code>dimensions</code> should not be empty</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="Params-Override-max_amount">
|
|
<td><code>maxAmount</code></td>
|
|
<td><code>int64</code></td>
|
|
<td>
|
|
<p>The upper limit for this quota override.
|
|
This value should be bigger than 0</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<h2 id="Params-Quota">Params.Quota</h2>
|
|
<section>
|
|
<table class="message-fields">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Required</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="Params-Quota-name">
|
|
<td><code>name</code></td>
|
|
<td><code>string</code></td>
|
|
<td>
|
|
<p>The name of the quota</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="Params-Quota-max_amount">
|
|
<td><code>maxAmount</code></td>
|
|
<td><code>int64</code></td>
|
|
<td>
|
|
<p>The upper limit for this quota. max_amount should be bigger than 0</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="Params-Quota-valid_duration">
|
|
<td><code>validDuration</code></td>
|
|
<td><code><a href="https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration">google.protobuf.Duration</a></code></td>
|
|
<td>
|
|
<p>The amount of time allocated quota remains valid before it is
|
|
automatically released. This is only meaningful for rate limit quotas.
|
|
value should be <code>0 < validDuration</code></p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="Params-Quota-bucket_duration">
|
|
<td><code>bucketDuration</code></td>
|
|
<td><code><a href="https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration">google.protobuf.Duration</a></code></td>
|
|
<td>
|
|
<p>The <code>bucketDuration</code> will be ignored if <code>rateLimitAlgorithm</code> is <code>FIXED_WINDOW</code>
|
|
value should be <code>0 < bucketDuration < validDuration</code></p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="Params-Quota-rate_limit_algorithm">
|
|
<td><code>rateLimitAlgorithm</code></td>
|
|
<td><code><a href="#Params-QuotaAlgorithm">Params.QuotaAlgorithm</a></code></td>
|
|
<td>
|
|
<p>Quota management algorithm. The default value is <code>FIXED_WINDOW</code></p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
<tr id="Params-Quota-overrides">
|
|
<td><code>overrides</code></td>
|
|
<td><code><a href="#Params-Override">Params.Override[]</a></code></td>
|
|
<td>
|
|
<p>Overrides associated with this quota.
|
|
The first matching override is applied.</p>
|
|
|
|
</td>
|
|
<td>
|
|
No
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<h2 id="Params-QuotaAlgorithm">Params.QuotaAlgorithm</h2>
|
|
<section>
|
|
<p>Algorithms for rate-limiting:</p>
|
|
|
|
<table class="enum-values">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr id="Params-QuotaAlgorithm-FIXED_WINDOW">
|
|
<td><code>FIXED_WINDOW</code></td>
|
|
<td>
|
|
<p><code>FIXED_WINDOW</code> The fixed window approach can allow 2x peak specified rate, whereas the rolling-window doesn’t.</p>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr id="Params-QuotaAlgorithm-ROLLING_WINDOW">
|
|
<td><code>ROLLING_WINDOW</code></td>
|
|
<td>
|
|
<p><code>ROLLING_WINDOW</code> The rolling window algorithm’s additional precision comes at the cost of increased redis resource usage.</p>
|
|
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|