TechBuzzPro

Cloudflare Worker Bot Analytics: Estimate Your Bill

· 6 min read · Apps & Browsers

In this article
  1. How Cloudflare Workers Billing Works
  2. Calculating Your Bot Analytics Requests
  3. Estimating CPU Time Costs
  4. Using the Cloudflare Pricing Calculator
  5. Factors That Can Increase Your Bill
  6. Common Mistakes When Estimating
  7. Frequently Asked Questions

To estimate your Cloudflare Worker bill for bot analytics, you need to know your total number of Worker requests and whether they are billed under the Free, Paid ($5/mo), or Enterprise plan. The cost is primarily based on requests and CPU time, with the paid plan including 10 million requests and 400,000 GB-seconds of CPU time per month; beyond that, you pay $0.30 per additional million requests and $12.50 per additional million GB-seconds.

How Cloudflare Workers Billing Works

Cloudflare Workers are billed on a usage-based model. Your monthly cost is the sum of charges for two main resources: requests and CPU time (measured in GB-seconds). Every time a Worker executes in response to an HTTP request, it counts as one request. CPU time is the total time your Worker code runs, multiplied by the memory allocated, expressed in GB-seconds (e.g., 1 GB of memory running for 1 second = 1 GB-second).

There is also a minimum monthly charge of $5 for the Paid plan, which includes a bundled amount of usage. If you stay under the included usage, you pay only the $5 flat fee. If you exceed it, you pay for the overage on top of the $5. The Free plan has no monthly fee but includes only 100,000 requests per day and 10 minutes of CPU time per day, with no overage—requests beyond that are blocked until the next day.

Calculating Your Bot Analytics Requests

Bot analytics in Cloudflare involves Workers that inspect incoming requests to classify them as bot or human traffic. Each request that hits your Worker (whether it is a bot or a real user) counts as a request. To estimate your bill, you first need to estimate your total monthly request volume. If you have analytics from your existing site or application, use that number. If not, you can estimate based on your average daily requests multiplied by 30.

For example, if your site gets 500,000 requests per day, that is 15 million requests per month. On the Paid plan, the first 10 million are included, leaving 5 million overage requests. At $0.30 per million, that overage costs $1.50. So your total bill would be $5 + $1.50 = $6.50, assuming you stay within the CPU time allowance.

Estimating CPU Time Costs

CPU time is trickier to estimate because it depends on how long your Worker code takes to run. A simple bot detection script that checks a header or IP might run in under 1 millisecond, while a complex machine-learning model could take 50 milliseconds or more. To estimate, you need to know your average execution time and memory usage.

For instance, if your Worker runs for an average of 2 milliseconds (0.002 seconds) with 128 MB of memory (0.128 GB), each request consumes 0.000256 GB-seconds. With 15 million requests, that is 3,840 GB-seconds total—well under the 400,000 GB-seconds included in the Paid plan. So you would not pay extra for CPU time. However, if your Worker is memory-heavy (e.g., 512 MB) and slow (e.g., 50 ms), each request uses 0.0256 GB-seconds, and 15 million requests would use 384,000 GB-seconds—still under the limit, but close.

Using the Cloudflare Pricing Calculator

Cloudflare does not provide an official public pricing calculator specifically for Workers, but you can use the formula above to build your own spreadsheet. Alternatively, you can check your current usage in the Cloudflare dashboard under Workers & Pages > Usage. That page shows your requests and CPU time for the current month, which you can use to project your bill. If you are just starting, you can run a test Worker for a day and extrapolate.

Remember that the Paid plan includes 10 million requests and 400,000 GB-seconds. If you expect to exceed those, multiply your overage requests by $0.30 per million and your overage GB-seconds by $12.50 per million. Add the $5 base fee. That is your estimated monthly bill.

Factors That Can Increase Your Bill

  • High request volume: Every request counts, including static assets if your Worker intercepts them.
  • Long execution times: CPU time is billed per GB-second; slower code costs more.
  • Higher memory allocation: Workers that use more memory multiply the CPU time cost.
  • Multiple Workers: If you have several Workers, their usage is combined for billing.
  • Bot traffic spikes: Bots can hit your site much more frequently than humans, so a bot attack can inflate your request count.

Common Mistakes When Estimating

One common mistake is forgetting that the Free plan has no overage—if you exceed 100,000 requests in a day, your Worker stops responding, which can break your bot analytics. Another mistake is using average CPU time without considering memory. A Worker with 512 MB of memory costs 4x more per second than one with 128 MB. Also, remember that the $5 Paid plan fee is not a credit—you pay it even if you use zero requests. Finally, do not forget that Cloudflare charges for requests that are sent to your Worker, even if the Worker returns an error or a redirect.

Frequently Asked Questions

Is the $5 Workers Paid plan enough for a small site?

For a small site with under 10 million requests per month and reasonable CPU usage, yes. The $5 plan includes 10 million requests and 400,000 GB-seconds, which is plenty for a typical blog or small business site. If you are using Workers for bot analytics, the CPU time is usually minimal, so you will likely stay within the included amount.

How do I see my current Worker usage?

Log into the Cloudflare dashboard, go to Workers & Pages, and click on Usage in the left sidebar. There you will see your requests and CPU time for the current month, updated in near real-time. You can also set up usage alerts to notify you when you approach a threshold.

What happens if I exceed the included usage on the Paid plan?

You are billed automatically for the overage at the standard rates: $0.30 per million additional requests and $12.50 per million additional GB-seconds. The overage is prorated to the second, so you only pay for what you use. There is no hard cap unless you set one in your account settings.

Can I use the Free plan for bot analytics?

Yes, but only if your traffic is low. The Free plan allows 100,000 requests per day, which is about 3 million per month. If you exceed that, your Worker will stop responding for the rest of the day, which could leave your site unprotected. For serious bot analytics, the Paid plan is more reliable.

Does bot analytics require a separate Worker?

Not necessarily. You can integrate bot detection logic into an existing Worker that handles other tasks, but that will increase the CPU time and request count for that Worker. Alternatively, you can create a dedicated Worker that runs before your main application, which makes it easier to track usage separately.

Are there any hidden fees?

No, the billing is straightforward: base fee plus overages for requests and CPU time. However, if you use other Cloudflare features like Cache Reserve or R2 storage, those are billed separately. Also, if you use Workers with Durable Objects, there are additional charges for those objects, but that is not relevant to basic bot analytics.