Skip to content

docs(limit-conn): re-port with Admin API, ADC, and Ingress Controller tabs#13215

Open
Yilialinn wants to merge 5 commits intoapache:masterfrom
Yilialinn:docs/update-limit-conn
Open

docs(limit-conn): re-port with Admin API, ADC, and Ingress Controller tabs#13215
Yilialinn wants to merge 5 commits intoapache:masterfrom
Yilialinn:docs/update-limit-conn

Conversation

@Yilialinn
Copy link
Copy Markdown
Contributor

@Yilialinn Yilialinn commented Apr 14, 2026

Summary

Re-port the limit-conn plugin documentation from API7 docs with all three configuration tabs:

  • Admin API (curl commands)
  • ADC (declarative YAML)
  • Ingress Controller (Gateway API and APISIX CRD sub-tabs)

Changes from existing doc

  • Added ADC and Ingress Controller tabs to all 6 example sections
  • Updated attribute table with correct types and constraints from source code audit:
    • redis_cluster_nodes: corrected from "at least two addresses" to "at least one address" (source: minItems = 1)
    • Added key_ttl attribute (integer, default 3600, for redis/redis-cluster)
    • rules.conn and rules.burst: documented as integer or string (supports variable expressions)
  • Added "Rate Limit by Rules" section (available from APISIX 3.16.0)
  • Both EN and ZH docs updated in this PR

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. doc Documentation things labels Apr 14, 2026
Copy link
Copy Markdown
Member

@kayx23 kayx23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a few remaining doc mismatches in this PR:

  1. default_conn_delay is still described incorrectly in the attribute table in both EN and ZH docs. It currently says it applies to concurrent requests exceeding conn + burst, but the implementation rejects requests at conn + burst and only delays requests after conn is exceeded.

  2. burst and rules.burst are still described as applying "per second". That wording is misleading for limit-conn, since this plugin limits concurrent requests rather than a time-windowed request rate.

  3. The Redis cluster docs are still internally inconsistent: the attribute table now says redis_cluster_nodes needs at least one address, but the Redis cluster example prose still says a minimum of two nodes is required for the plugin configuration.

Implementation references:

  • apisix/plugins/limit-conn/util.lua
  • apisix/utils/redis-schema.lua

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refreshes the limit-conn plugin documentation (EN + ZH) by re-porting content from API7 docs and adding multi-surface configuration examples (Admin API, ADC, Ingress Controller), plus updated attribute details and a new rules-based limiting section.

Changes:

  • Added Docusaurus tabbed examples for Admin API / ADC / Ingress Controller across all example sections.
  • Updated the attribute tables to reflect current schema constraints (e.g., redis_cluster_nodes minItems, key_ttl, rules.* types).
  • Added a “Rate Limit by Rules” section (APISIX ≥ 3.16.0) with sequential rule behavior examples.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
docs/en/latest/plugins/limit-conn.md Re-ported and expanded EN docs with tabbed examples, updated attributes, and “Rate Limit by Rules” section.
docs/zh/latest/plugins/limit-conn.md Same as EN in Chinese, including updated attribute table and tabbed examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/en/latest/plugins/limit-conn.md
Comment thread docs/zh/latest/plugins/limit-conn.md
Comment thread docs/en/latest/plugins/limit-conn.md Outdated
Comment thread docs/zh/latest/plugins/limit-conn.md Outdated
Yilialinn and others added 3 commits April 16, 2026 15:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| redis_cluster_ssl | boolean | False | false | | If true, use SSL to connect to Redis cluster when `policy` is `redis-cluster`. |
| redis_cluster_ssl_verify | boolean | False | false | | If true, verify the server SSL certificate when `policy` is `redis-cluster`. |
| rules | array[object] | False | | | An array of rate-limiting rules that are applied sequentially. Available in APISIX from 3.16.0. You should configure one of the following parameter sets, but not both: `conn`, `burst`, `default_conn_delay`, `key` or `rules`, `default_conn_delay`. |
| rules.conn | integer or string | True | | > 0 or variable expression | The maximum number of concurrent requests allowed. Requests exceeding the configured limit and below `conn + burst` will be delayed. This parameter also supports the string data type and allows the use of built-in variables prefixed with a dollar sign (`$`). |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable expression

Should use lua-resty-expr consistently and link it to https://github.com/api7/lua-resty-expr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Documentation things size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants