# When the usage meter costs more than usage

*28 September 2026 · Cloudflare, Infrastructure, Finance*

30M API requests on Cloudflare. Just to count them.

Writes @ $1/M rows. DO invokes @ $0.15/M.

- Direct D1: $30
- DO (1 invoke + 1 write): $34.50 + duration
- Queue → 100-batch D1: $36.30
- Chatty DO (4 writes/req): $124.50 + duration

The usage meter can cost more than the usage.

Looking at alternatives, the most likely would be a custom solution.

> When your API handles 19 million requests, every millisecond matters.
> 
> Today I reduced my API response time by 1.1 seconds.
> 
> As a rough estimate, 1 million requests saved by 1.1 seconds equals nearly 12.7 days of total time recovered.
> 
> Here is how I achieved it:
> 
> - Shifted accounting into waitUntil so usage and bandwidth logging no longer delay the response.
> - Merged usage and bandwidth recording into a single Durable Object call and transaction.
> - Eliminated a separate database round trip.
> - Aggregated cells per row in SQL, cutting repeated data transfer; the benchmark dropped from about 399 KB to 176 KB.
> - Combined metadata and page retrieval into one D1 call.
> - Activated Smart Placement in Wrangler so the worker sits near the database.
> 
> Cloudflare D1 read timing is in single digits, but the round trip adds triple-digit latency; that is the remaining bottleneck. Next, I would test the D1 read nodes.
>
> — @mohitdotdev

[View original on X](https://x.com/mohitdotdev/status/2104567456392192034)
