mirror of
https://github.com/versity/versitygw.git
synced 2026-04-09 07:39:05 +00:00
This is part of the thread exhaustion issue (#1815). This PR introduces: * A **maximum Fiber HTTP connections limit** * A middleware that enforces a **hard limit on in-flight HTTP requests** When the in-flight request limit is reached, the middleware returns an **S3-compatible `503 SlowDown`** error. The same mechanism is implemented for the **admin server** (both max connections and max in-flight requests). All limits are configurable via **CLI flags** and **environment variables**, for both the `s3api` server and the `admin` server. --- | Setting | CLI Flag | Alias | Environment Variable | Default | | --------------- | ------------------- | ----- | --------------------- | ------- | | Max Connections | `--max-connections` | `-mc` | `VGW_MAX_CONNECTIONS` | 250000 | | Max Requests | `--max-requests` | `-mr` | `VGW_MAX_REQUESTS` | 100000 | --- | Setting | CLI Flag | Alias | Environment Variable | Default | | --------------- | ------------------------- | ------ | --------------------------- | ------- | | Max Connections | `--admin-max-connections` | `-amc` | `VGW_ADMIN_MAX_CONNECTIONS` | 250000 | | Max Requests | `--admin-max-requests` | `-amr` | `VGW_ADMIN_MAX_REQUESTS` | 100000 |