Rate limits
Rate limits stop one sender from flooding Skirl. They are generous: a script or tool that sends now and then never meets them. Each sender has an allowance that fills up again by itself; a sender who uses it up gets the answer 429, with how many seconds to wait.
The numbers in force, and where to change them, are in Admin → Settings → Rate limits: Admin settings. This page explains what they mean.
Who counts as one sender#
- Signed out: one address. An IPv4 address counts on its own; an IPv6 address counts with its whole /64 network, as one home or server usually has.
- Signed in: one person, whether with a password, a token or a browser session. All of a person's tokens, scripts and browser tabs share one allowance.
Behind a reverse proxy that Skirl does not trust, every visitor seems to come from the proxy's address, and everyone signed out shares one allowance. The setup wizard's connection test finds this (Visitor addresses are passed through); the fix is Skirl is behind a reverse proxy.
Requests#
Every request counts once: sending a message, reading a topic, opening a stream, and everything Skirl's own pages do in a browser. The health check and downloading a file do not (downloads have a daily allowance).
A sender has a burst: that many requests may come at once. After that, one more comes back every so often. Say the burst is 60 and one comes back every 5 seconds:
- a script that sends 60 messages in a loop gets them all through at once;
- the 61st, straight after, is refused with "Retry-After: 5";
- from then on it may send one every 5 seconds, 12 a minute;
- after 5 minutes without a request (60 × 5 seconds) it has its whole burst of 60 again.
The same with a burst of 600 and one back every 500ms: 600 at once, then two a second, full again after 5 minutes. A person signed in has the signed in numbers; everyone else has the signed out ones.
What the refused request gets back:
HTTP/1.1 429 Too Many Requests
Retry-After: 5
{"code":42901,"http":429,"error":"limit reached: too many requests"}In Skirl's pages the same refusal reads "Too many requests. Try again in 5 seconds."
Subscriptions#
A subscription is a stream that stays open to wait for messages: a phone app listening to a topic, an ntfy client's subscribe command, a script reading a topic's stream, and each open Skirl tab, which keeps one stream for live updates. One stream counts once, however many topics it listens to.
The limit is how many may be open at the same time: per address signed out, per person signed in. One more is refused with 429 "limit reached: too many active subscriptions", without a Retry-After: a new one works as soon as another one closes.
New topics#
Only people signed in may make topics, and how many they may make has a burst and a refill like requests: say 100 at once, then one more every minute. It counts topics made by sending to a new name, from Topics and Connect a system, and from Admin → Topics.
One more is refused with 429 "limit reached: too many new topics, please wait" and a Retry-After; Skirl's pages say "Too many new topics. Try again in …".
Failed sign-ins#
A failed sign-in is any wrong password or bad token, wherever it is sent:
- a wrong password on the sign-in page, or as the current password under Settings → Password;
- a wrong user name or password from a script or app;
- a token that is unknown, revoked, expired, or belongs to a disabled person;
- a wrong setup token in the setup wizard, which counts as a bad token.
Bad tokens and wrong passwords are counted apart, so one bad script does not lock everyone out. Say the limit is 10 counted over 10 minutes. Each count's 10 minutes start at its first failure, and once a count reaches 10, what it counts is refused, the right ones too, until its 10 minutes are up.
Bad tokens#
Counted per address. After 10 bad tokens from an address, every token from that address is refused, a right one too. Passwords from that address still work, so people there can still sign in.
Wrong passwords#
Counted per address and user name. After 10 wrong passwords for one user name from an address, that user name's password is refused from that address. Everyone else there still signs in with their own password, and the same person can still sign in from another address.
Two more things count:
- A wrong password counts toward the address's tokens as well: after 10 wrong passwords from an address, its tokens are refused too. ntfy does the same.
- An address with 100 failures in those 10 minutes (ten times the limit), wrong passwords for any user names and its bad tokens together, has every password refused too, so it cannot try a few passwords on every name there is. Its bad tokens alone never get there: they stop counting at 10.
What a refused sign-in gets#
The answer is the same for both, with how many seconds are left:
HTTP/1.1 429 Too Many Requests
Retry-After: 600
{"code":42909,"http":429,"error":"limit reached: too many auth failures"}Skirl's sign-in page says "Too many failed attempts from this address. Try again in 10 minutes." Browsers that are already signed in keep working; a request with no password or token at all is never a failure.
The usual cause is a forgotten script with an old token that retries every minute: within ten minutes every token sent from that machine is refused, and from anything else behind the same router. Signing in with a password still works. Find the script (its own log shows the 401 answers before the 429s), and give it a new token or stop it.
This limit applies to every address, those without limits too, and even when the other limits were turned off. Set Failed sign-ins before a pause to 0 to turn it off, for tokens and passwords alike.
Addresses without limits#
Addresses and CIDRs listed in Addresses without limits meet no limit on requests, subscriptions or new topics. Failed sign-ins still count. List a machine of your own that sends a lot, such as a monitoring host. The address is the one Skirl sees: behind a proxy, the visitor's own address only when the proxy is trusted.
Changing the limits#
Admin → Settings → Rate limits holds every limit. Each is listed, with its starting value and what saving a change does to senders already counted, in Admin settings.
Turning rate limits off#
Started with --no-rate-limit (or SKIRL_NO_RATE_LIMIT=true in its environment), Skirl applies no limit to requests, subscriptions or new topics, for anyone; only the failed sign-in limit stays. The server says so in its log when it starts:
rate limits are off (--no-rate-limit); only the failed-login limit appliesAdmin → Settings then shows Rate limits as Off, and its page says "Turned off when Skirl was started." with where it was set; the fields cannot be changed. Start Skirl without it to use the limits again: the values saved before apply. Use it only on a server nobody else can reach, or for a test.
Other limits#
These are fixed, not settings:
- Send a test: 6 test notifications a minute per person ("too many test notifications, please wait").
- Run checks again on Diagnostics: 6 runs a minute for the whole server ("too many diagnostic runs, please wait").
- Tokens: 100 per person (How many tokens).
- Files: size and download allowances (Attachments).