---
title: "Vercel Fluid Compute Active CPU: What Burned My Hobby Quota"
description: "My Vercel Hobby team was paused for Active CPU. The cause was proxy.ts on every page view. How to find your culprit in the Usage dashboard, and the fix."
canonical: "https://www.razi.pro/blog/vercel-fluid-compute-active-cpu-hobby"
date: "2026-12-03"
tags: ["Vercel", "Next.js", "Serverless", "Performance", "Cost Optimization"]
source: "razi.pro"
---

# Vercel Fluid Compute Active CPU: What Burned My Hobby Quota

My site went down on a Thursday night, and the code that did it never touched a database.

On 5 November 2026 Vercel paused my Hobby team for going over its Fluid compute **Active CPU** allowance. Every deployment stopped serving. The culprit turned out to be \`proxy.ts\`, the file Next.js 16 used to call middleware. It was synchronous, did no I/O, and still used **43%** of the CPU my main project burned that month.

I am putting the lesson at the top so you get it for free: **the route that looks slowest is usually not the one eating your CPU, and on Hobby the Usage page can tell you which one is, if you click the right tab.** I lost a week to the wrong answer first.

This post is the whole path: what got paused, why wall time misled me, how to find your own culprit step by step, and the matcher change that took proxy CPU to roughly zero.

---

## The pause

Vercel's Hobby plan includes, per month, [4 hours of Active CPU, 360 GB-hours of Provisioned Memory and 1 million function invocations](https://vercel.com/docs/functions/usage-and-pricing). It is shared by every project on the team.

Go over any of them and the docs are blunt about what happens. A paused production deployment answers with \`503 DEPLOYMENT_PAUSED\`, and "in most cases, a Hobby team that exceeds its usage limits must wait until 30 days have passed before it can use fluid compute again". It also does not resume on its own when the 30 days end. Your options are support or moving the projects to a Pro team. The [Hobby plan page](https://vercel.com/docs/plans/hobby) says the same about the 30 days.

My numbers for the period 7 October to 6 November:

- razi.pro used **3h 34m** of the 4h on its own.
- Three small side projects added under an hour between them. Together they tipped the team over.
- The team's status said why it was blocked: the overage type was Fluid CPU duration. Not memory, not invocations.

> **A warning worth the detour.**
> The allowance is per team, not per project. A forgotten hobby project that serves a few thousand bot requests a day spends the same 4 hours your main site does. Before you optimise anything, open the Usage page with no project filter and read the split by project. It costs you a minute and it tells you where to look.

I was lucky. Vercel granted a one-time courtesy unblock while I shipped the fix. You should assume you will not get a second one.

---

## Wall time is not Active CPU

Before you read on: if one route takes 4 seconds to answer and another takes 20 milliseconds, which one costs more CPU?

You cannot tell from that. And that is exactly the trap I fell into.

Vercel's [pricing page for Fluid compute](https://vercel.com/docs/functions/usage-and-pricing) defines Active CPU as "the CPU time your code actively consumes", and says you are "only billed during actual code execution and not during I/O operations". Their example: a function that spends 100 ms processing and 400 ms waiting on a database is billed for 100 ms of CPU.

Provisioned Memory works the other way. It is billed in GB-hours for as long as the instance is alive, including while it waits on I/O.

So there are two very different shapes of expensive:

| Route shape | Wall time | Active CPU |
| --- | --- | --- |
| Calls an AI model, waits 3 s, returns JSON | High | Low |
| Parses a big bundle and runs a few string checks on every request | Tiny | Small per request, large in total |

My first diagnosis, at the end of October, used a per-path ranking sorted by execution time. The MCP endpoint sat on top with about 85% of it. I hardened MCP: refused monitoring bots, cached the tools list, required a key for tool calls. It was all worth doing. Total CPU barely moved.

The ranking I used measures **wall-clock time**. MCP requests spend most of their life waiting on the network. They looked expensive in that list and were cheap where it mattered.

---

## How to find what burns your Active CPU

Here is the order I would use now. Steps 1 to 3 are all you need on Hobby.

### 1. Split by project

Open your team in the Vercel dashboard, then **Usage**. Pick the current period and find the Active CPU chart (mine is labelled **Fluid Active CPU**). Read the per-project breakdown. If one project dominates, filter to it.

Vercel's own [Active CPU troubleshooting guide](https://vercel.com/kb/guide/optimize-active-cpu-on-fluid-compute) starts the same way: choose the window, filter to the project, then compare Active CPU with invocations and memory.

### 2. Split by type

This is the step I skipped, and it is the one that found the problem.

On the Active CPU chart there is a **Type** tab next to the default view. It splits the CPU into **Functions** and **Middleware**. Mine read:

- Middleware: **1h 32m** (43%)
- Functions: **2h 1m**

Middleware was flat at roughly 165 to 200 seconds a day, every day of the month. No spikes. That flatness is a clue in itself: it tracks traffic volume, not any one feature.

> **A small UI trap.**
> In the version of the dashboard I used, the Type control is a radio button that did not respond to clicks on the input itself. Clicking the label next to it worked. If the chart does not change, click the text, not the circle.

Do not take my word that middleware counts. Vercel's guide says it outright: "Routing Middleware also uses Fluid compute, and Active CPU pricing." Turning Fluid off for your functions does not remove it.

### 3. Split by route

If Functions is the big slice, you want CPU per route. Vercel's guide points you to **Observability → Functions**, where the route list shows Active CPU and invocations side by side. Divide one by the other and you get CPU per invocation, which separates "busy" from "expensive".

On Hobby, Observability kept only about the last 12 hours of data for me. That is enough to spot a hot route today. It is not enough to explain last month.

### 4. If you need a month of per-path data

The Vercel CLI can call the API directly with \`vercel api\`. One endpoint I used is:

\`\`\`bash
vercel api "/v4/usage/top?sortKey=execution_time&pathType=target_path&projectId=&from=2026-10-07T00:00:00.000Z&to=2026-11-06T00:00:00.000Z&limit=40"
\`\`\`

It returns invocations and \`execution_time\` per path for any window. Two warnings:

- **This endpoint is not in Vercel's public REST API documentation.** I found it by watching what the dashboard requests. It could change or disappear.
- **\`execution_time\` is wall time, not CPU.** This is the ranking that misled me. Use it to see where requests go, never to rank CPU.

What did work: I fitted daily function CPU from the Type split against daily per-path wall time from this endpoint. That separated the routes that actually cost CPU from the ones that only waited. It is a lot of effort. Do steps 1 to 3 first.

---

## Why proxy.ts ran on every page view

Once the Type tab said "middleware", the next question was why a tiny file cost so much.

### Proxy is a function, and in Next.js 16 it runs on Node.js

In Next.js 16, the \`middleware\` file convention was [renamed to \`proxy\`](https://nextjs.org/docs/app/api-reference/file-conventions/proxy). The same version made the [Node.js runtime the default](https://nextjs.org/docs/app/api-reference/file-conventions/proxy#runtime) for it, and you cannot set \`runtime\` in a proxy file.

The docs also note that proxy runs before filesystem routes, and that without a \`matcher\` it runs on **every request**, including static files.

On Vercel, each request your matcher lets through is an invocation that uses Active CPU. My proxy did almost nothing per request. But "almost nothing" includes loading and evaluating the bundle, then running the checks. The cost was a small per-request floor multiplied by volume.

### What my proxy was doing

It had picked up five jobs over a year:

1. A fail-closed gate on the admin pages and \`/api/admin/*\`: no session cookie, no entry.
2. A trailing-slash 308 redirect (Next's own was turned off for an analytics proxy path).
3. A 307 redirect sending known AI crawlers to a markdown copy of each content page.
4. A redirect sending visitors from Kerala to the Malayalam edition.
5. Rewrites for 22 tool subdomains, so a short subdomain served its tool page.

Jobs 2 to 5 needed to see every page request. So the matcher covered every page.

### The matcher was not lazy

This is the part I want you to see, because I thought I had already done the right thing. The old matcher excluded nearly everything static:

\`\`\`ts
export const config = {
  matcher: [
    "/api/admin/:path*",
    "/((?!api/|_next/|favicon\\.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp|avif|ico|css|js|mjs|map|txt|xml|json|webmanifest|woff|woff2|ttf|otf|eot|mp4|webm|mp3|wav|pdf)$).*)",
  ],
};
\`\`\`

No \`_next/\`, no images, no fonts, no \`robots.txt\` or sitemaps. Static assets were not the problem.

Page views were. And most page views on a small site are not people.

### The bots

Vercel's Firewall has a Traffic view that works on Hobby and shows the last 24 hours. On one day I looked, it reported about 30,000 requests, and it classed 75.8% of them as bots. Secret-file scanners probing \`/.env\` and \`/.git/config\` on every subdomain. MCP monitors. Meta, Google and Ahrefs crawlers. A few thousand unidentified AI scrapers and headless browsers.

Every one of those that asked for a page passed the matcher, and every one paid the proxy's floor. Nothing in the proxy was slow. It was just always on.

---

## The fix: run proxy only where it must run

The idea is simple. Keep in the proxy only the job that genuinely needs code. Move everything that is just "match a pattern, send a redirect or rewrite" into \`next.config.ts\`, where Vercel applies it at the routing layer without invoking a function.

### The new proxy matcher

Only the admin gate stayed. The matcher now names the admin surfaces and nothing else:

\`\`\`ts
export function proxy(request: NextRequest) {
  return guardAdminRoutes(request) ?? NextResponse.next();
}

export const config = {
  matcher: ["/api/admin/:path*", "/admin/:path*", "/:lang(en|ml)/admin/:path*"],
};
\`\`\`

The third entry matters. Admin pages also answer under a locale prefix, \`/en/admin\` and \`/ml/admin\`. A gate that matched only \`/admin\` would have waved those straight through. Matcher values must be constants the build can read, so the locale list is written out, and a unit test checks it against the real locale list.

> **A warning worth the detour.**
> When you narrow a matcher around a security check, the check's own tests keep passing. They call \`proxy()\` directly and never evaluate the matcher. Drop \`/api/admin/:path*\` by accident and twenty admin routes lose their gate while CI stays green. Add a test that asserts on the matcher array itself. Next.js ships \`unstable_doesMiddlewareMatch\` in \`next/experimental/testing/server\` for exactly this; I compiled the matcher with Next's own matcher code instead. Either costs ten minutes.

The authoritative admin check still lives in the server code. The proxy only checks for the presence of a session cookie, so an anonymous caller never reaches a handler.

### The page rules moved to next.config.ts

Next's [\`redirects\`](https://nextjs.org/docs/app/api-reference/config/next-config-js/redirects) and rewrites accept \`has\` and \`missing\` conditions on headers, cookies, query and host. That is enough to express all four page jobs.

The AI-crawler redirect, as a routing rule:

\`\`\`ts
{
  source: "/:section(blog|tools|compare|how-to|help)/:rest((?!.*\\.md$).+)",
  has: [{ type: "header", key: "user-agent", value: ".*(GPTBot|ClaudeBot|PerplexityBot).*" }],
  destination: "/:section/:rest.md",
  permanent: false,
}
\`\`\`

(The real user-agent pattern is longer and case-insensitive. This shows the shape.)

A tool subdomain, as a rewrite keyed on the host:

\`\`\`ts
{
  source: "/:path*",
  has: [{ type: "host", value: "qr\\.razi\\.pro" }],
  destination: "/en/tools/qr-code/:path*",
}
\`\`\`

The Kerala redirect checks Vercel's geo headers with \`has\`, and uses \`missing\` to skip anyone with a language cookie, client-side navigation fetches and server actions. One honest caveat from the commit: **whether Vercel exposes its geo headers to routing rules, as it does to functions, is not documented.** If it does not, that rule simply never fires and Kerala visitors stay on English with the language switcher. I accepted that trade.

> **A bug \`next start\` caught for me.**
> Next applies rewrites in sequence. My first subdomain rewrite produced a path that matched its own source again, and the tool pages 404ed. A proxy rewrite never had this problem because it ran once. The fix was to make sure no rule can match its own output. Run \`next build && next start\` and curl every rule before you deploy; I ran 21 checks and this was the one that failed.

---

## The result

The fix went to production on 6 November.

- **Middleware Active CPU went to roughly zero** and stayed there. Admin pages are the only thing that invokes the proxy now, and that is me.
- In the following period, razi.pro used **2h 16m** of Active CPU, down from 3h 34m, and that window still included two weeks before the fix.
- Function CPU now runs at a few minutes a day.

With middleware gone from the chart, the Type split exposed the next biggest cost: newsletter issue pages were being re-rendered 150 to 300 times a day at about 4 seconds each, because crawlers and deploys kept emptying the cache. They are now prerendered at build time. Same method, second win.

The MCP hardening I did first was still worth doing for other reasons. It just was not the CPU fix, and I would have known that a week earlier if I had clicked one tab.

---

## Checklist

If your Vercel Hobby limits are close, or you are already paused:

- [ ] Open **Usage** with no project filter. Find which project uses the Active CPU.
- [ ] On the Active CPU chart, open the **Type** tab. Read Functions versus Middleware.
- [ ] If middleware is a large slice, read your \`proxy.ts\` (or \`middleware.ts\`) matcher. Count how many paths it covers.
- [ ] Move every pure redirect and rewrite into \`next.config.ts\` with \`has\` and \`missing\`. Keep proxy for logic that genuinely needs code.
- [ ] Narrow the matcher to those paths only. Add a test that asserts on the matcher array.
- [ ] If Functions is the large slice, use **Observability → Functions** and divide Active CPU by invocations per route.
- [ ] Do not rank CPU by execution time or response time. That is wall time.
- [ ] Open **Firewall → Traffic** and see how much of your volume is bots. Every bot page view is a function call you pay for.
- [ ] Verify with \`next build && next start\` and curl before deploying routing rules.

Then watch the Type split for a week. A flat line that tracks traffic is the signature of a per-request floor. Make that floor run less often and it goes away.
