denoland / deploy_feedback

For reporting issues with Deno Deploy
https://deno.com/deploy
74 stars 5 forks source link

[Bug]: Incorrect estimated size of KV database #599

Closed cknight closed 9 months ago

cknight commented 10 months ago

Problem description

The estimated size of my KV database on Deploy for my 'onjara' project is 318KiB. However there are only two entries on KV which total roughly 12KiB in size perhaps. While the values change daily, the maximum size that two entries can be is 132KiB (2 KiB key + 64 KiB value x 2 entries).

Steps to reproduce

Go to https://dash.deno.com/projects/onjara/kv. View 'Estimated Size" which shows 318KiB. Scroll down to data and see only two entries.

Expected behavior

Estimated size accurately reflects the data in KV.

Environment

No response

Possible solution

No response

Additional context

No response

lucab commented 9 months ago

Thanks for the report. The displayed size is a an estimated value reported by the DB, based on some data sampling approximation. It is generally accurate for sets larger than 3 MiB, but for smaller datasets with few entries like in your case it can only provide a very rough approximation. For that reasons, the value is not used for any kind of billing and it only provides a general idea about DB size, mostly for cases of larger datasets that cannot be visually estimated.