Running your application
Budgets and unusual traffic
A monthly budget per environment to compare Brewless's estimate with, a word when a day is unusual, and emergency mode to tighten the firewall for a day.
On this page
On the Costs tab of an environment's overview, Budget and unusual traffic gives the environment a monthly budget, tells you when a day goes past what is usual for it, and offers to tighten its firewall for a day. Nothing is limited by a budget, and nothing at bunny.net changes until someone clicks.
A budget
Set a monthly amount in euros for the environment. Brewless compares its own estimate of the month with it:
- the run time of the web and worker containers it records every hour, at Scaleway's list price for their size;
- the vCPU time of the environment's own Serverless SQL Database.
The month so far is carried over to the whole month. The estimate leaves out bunny.net, buckets, Managed Databases, Scaleway's free allowance and VAT, and it trails the providers by up to an hour. What you are billed is on the Costs page; it can differ.
Brewless looks at the estimate on every deploy, when you open the environment, and once an hour. When it goes past the budget, the organisation's owners and admins get one mail that month. That is all: a budget is informational and never a limit. Everything keeps running.
Only someone who may manage the applications sets or clears a budget; each change is in the audit trail.
An unusual day
Every hour Brewless compares yesterday with the 28 days before it, from two in the morning on, once the day's figures are recorded:
| Figure | From |
|---|---|
| Requests that reached the web container | bunny.net's log, as counted for avoidable wake-ups |
| How long the web container ran | Scaleway, per hour |
| The most instances of it at once | Scaleway, per hour |
| The vCPU time of the environment's own Serverless SQL Database | Scaleway, per hour |
A day is unusual when one figure is above the 95th percentile of the days before it. With fewer than 7 days to compare with, nothing is called unusual, and a figure has to reach a floor first: 1,000 requests, an hour of run time, 2 instances, or an hour of vCPU time.
Brewless reads only what it recorded already and bunny.net's log. It never sends a request to your application, so it wakes no container.
An unusual day comes with its cause, where the data has it: how many requests came from known bots, scanners, unknown bots and humans, and the five busiest paths at the container that day, without their query string. Paths are read while bunny.net still has the day's log (three days). No address and no user agent is kept.
The owners and admins get a mail, the console shows a line at the top of every page, and the Costs tab of the environment's overview shows the figures. A day is looked at once. A proposal nobody acted on gives way to a newer one, and lapses after seven days.
Note
A busy day can be good news: a sale, a launch, a mention in the press. That is why Brewless only proposes. It was expected puts the proposal away without changing anything.
Emergency mode
Tighten for 24 h puts a temporary layer over the firewall of brewless.yml, after you confirm it:
rate_limit: half the file's rate limit, at most 150 requests per 10 seconds per address, or 150 when the file sets none, and it blocks (not only logs). The file's way of counting (rate_limit_key) stays.bot_control: challengeon Shield Advanced and higher. Shield Basic has no bot detection, so there the layer is the rate limit alone.
Real visitors over the lower limit are turned away too. It needs a Shield zone: an environment with firewall: false gets no button.
The layer comes off by itself after 24 hours, or sooner with Take it off now. The zone is then set back to exactly what brewless.yml asks: its rate limit, or no rate limit rule of Brewless's when the file names none, and its bot_control. When the file does not name bot_control, the zone gets back the bot detection it had before the layer.
While the layer is on:
- a deploy keeps it on;
brewless planshows it asfirewall.temporary, with what the layer sets, what comes back, and when;- placing it, and taking it off, are in the audit trail, and the owners and admins get a mail for each.
When bunny.net does not answer, nothing is marked done: Brewless tries again every hour until the zone stands as wanted.
Only someone who may manage the applications turns emergency mode on or off.