Storage per-account limit on Durable Objects

Hi!

I’ve been wondering about the following limit on Durable Objects:

  • 50 GB total storage per account

I know that there’s other limits around key and value sizes, as well as no limit per Durable Object '“separate from the account limit” and these have been asked about many times on the forum, but this one is a little vague to me:

  • When I should be worried about being affected by it?
  • What happens if I hit this limit?
  • What dictates how this limit increases (or decreases)?
  • Is is for in-memory storage or only storage that you state in the storage api?
  • How long does it take objects to get evicted from memory?

As much information about this would be very welcome.

You shouldn’t. 50 GiB is a lot of data when you’re limited to 128 KiB per key/value. In any case you can monitor your current storage usage in the dashboard.

I honestly don’t know. I doubt your application will stop working, but you should reach out to sales before this happens.

Not sure what you mean here. The limit is unlikely to be lowered. In the odd case Cloudflare does decide to lower it, I strongly expect they will notify everyone prior to the change. The limit can be raised for your account on request.

This limit is for data stored using the Persistent Storage API. It does not count data stored in memory since that is lost when the Durable Object instance is evicted.

A Durable Object instance can be evicted at any time for a number of reasons (e.g. due idling, runtime upgrades or a meteor hitting the DC - or simply because it’s a Tuesday). Don’t store anything important in memory.

I should have worded this differently, I meant about how the dashboard storage number goes up or down. Though the answer about that is really answered by the storage api question. I’m assuming that as any keys are deleted this frees’ up storage (i.e. number goes down on dashboard).

Yup. Writing to a new key causes the number to go up. Deleting that same key will cause it to you down again. The metric shows the total storage usage across all DO instances of each DO class in all Workers.