Limits and blocking
Set what a Bastion lets each client address do and draw from the main installation, and what a refused client is told.
On this page
Two stages
- Who
limits:writechanges the preset, the mode, the throughput and the figures;endpoints:writethe addresses and switches- Where
- main installation, Admin area › Bastions, the section Limits of a card; the chart
quader-bastionfor the edge
A request passes the coarse limit of HAProxy Ingress (edgeLimit of the chart), then the Bastion's own limits per client address,
which know credentials and misses. The Bastion's figures belong to its registration, not to its chart. Every replica receives them
within a few seconds, without a restart. A replica that starts without reaching the main installation uses the figures it stored last,
or strict defaults.
| Figure | A new registration | What a normal command needs |
|---|---|---|
| Requests without a credential | 50 a second, burst 1,000 | An anonymous docker pull of 40 layers: 48 requests in 0.3 s |
| Requests with a credential | 200 a second, burst 4,000 | An install of up to 4,000 packages at once |
| Pages of the web interface | 20 a second, burst 100 | A browser's first visit: 17 to 29 requests |
| Misses (requests that need the main installation) | 1,000 a minute without, 4,000 with a credential | On an empty cache every request is one |
| Blocking | 3,000 refusals in a minute block the address for 15 minutes, doubling up to 24 hours | Only a flood: twice the anonymous rate, or 1.25 times the rate with a credential |
edgeLimit.requestsPerSecond, edgeLimit.connections |
1,000 a second, 256 at once, refused 429 by the ingress |
An npm ci about 190 a second; dotnet restore has no bound of its own |
Every request the Bastion answers counts, also a scanner's /.env, so a scanner is refused and blocked like any flood. The figures
count per address, not per person: list a NAT of many build jobs under Networks without flood protection and in
edgeLimit.exemptCIDRs. Keep the edge's figure above the figure with a credential; the card warns otherwise. Another ingress
controller ignores the edge's annotations; behind a load balancer that hides client addresses, switch on its proxy protocol.
Without a Valkey of its own each replica holds its share: every figure divided by the replicas, or by autoscaling.maxReplicas.
The anonymous ceiling
All anonymous clients together may send the main installation 100 requests a second, a burst of 2,000 and 36,000 an hour by default.
What the Bastion serves from its cache does not count. Above it an anonymous client gets 503 with a time to retry, while signed-in
clients and cached content are served on. The hour holds about 75 cold npm ci of 475 packages.
Anonymous clients and remote repositories
An anonymous client never makes a remote repository fetch from its upstream: it gets what the remote holds, and a version nobody
fetched yet answers 403 populate_not_permitted. Nobody on the internet can spend your quota at Docker Hub through a Bastion. To give
anonymous visitors new versions, make the remote a mirror or give the clients a token.
The throughput
A Bastion reads at most 200 MB/s from the main installation and the object store together, its anonymous clients a quarter of it, by
default. Set it to the Bastion's share of the link between the two networks; what it serves from its cache does not cross that link.
At the cap running downloads slow down and share it. A new download that would wait longer than the queue time, 5 s, gets 503 with
Retry-After.
Limits on the card
| Part | What it does |
|---|---|
| Warnings | An ingress figure below a flood figure; an address the Bastion connects from that is not listed |
| Preset | Internet (strict, administrators too; a new registration's), Partner network (the installation's profiles), Internal (no limits, everything counted). Its dialog names each rule and figure it replaces; Custom means one differs |
| Mode | Enforce, or Audit, which counts and refuses nothing by the limits; flood protection, ceiling, slots and throughput still hold. Switch to Enforce first shows what this Bastion's own rules would have limited in the last 24 hours |
| Maximum throughput | MB/s, empty for unlimited, with a bar of the throughput now |
| Now | The replicas' last five minutes: cache, hits, callers limited, addresses blocked, which leads to the blocks |
| Details | Hide repositories, the flood figures per class, the timeout after failed sign-ins, the networks without flood protection, the slots, the anonymous ceiling, the throughput's classes, the addresses, and Rules of this Bastion |
Two budgets count a download through a Bastion: the rules of the Bastion's place count what the Bastion serves, and the installation's download limits count what the installation serves, including the Bastion's fetches.
Several deployments
Deployments of one registration heard within three minutes divide some figures equally, rounded down; the card's Replicas line says "2 addresses · each holds half of the ceiling, slots and throughput".
| Figure | With two deployments |
|---|---|
| Anonymous ceiling, slots, throughput, each class's hourly volume | Half each |
| Flood figures, a caller's budgets, blocks, cache | Each deployment's own, in full |
A new deployment takes its share at its first handshake; one silent for three minutes leaves its share to the others.
quader_bastion_deployments shows the count.
What a client is told
A refusal of the Bastion's own limits, a block or the timeout after failed sign-ins answers 429 with Retry-After and the whole
wait in words. On the ClamAV definitions it is 503. NuGet and Ansible clients are told at most 30 seconds and come back until the
wait is over.
Nothing a client receives names your main installation: no address, no other repository, no request ID, no rule. A write answers
"This address is read-only: it serves downloads and accepts no uploads." without saying where to publish. An upstream's failure
reaches the client as "The package could not be fetched right now." without the remote's name. A request body without a length is
held in memory, at most four times bastion.main.max_forwarded_body per replica, then 503. The codes are in
Error codes.