Computation and Storage Cost Documentation

Cost of Compute and Storage Transactions on the Internet Computer

3 Likes

From the linked document:

Transaction Description All Application Subnets
GB Storage Per Second For storing a GB of data per second 127,000

From my pc:

~$ python
>>> cycles_per_year = 127_000 * 60 * 60 * 24 * 30 * 12
>>> t_cycles_per_year = cycles_per_year / 1_000_000_000.0
>>> t_cycles_cost_usd = 1.42
>>> t_cycles_per_year / t_cycles_cost_usd
2781.83661971831

Am I missing something? Is it 1 XDR per 1T cycles?

I am on my phone and and quickly replying but when I saw this line my first thought was:

I think you may be dividing by billion, not trillion? And I believe by your variable name that you are looking for Trillion.

(This may not address your higher level point, but just saw what I thought could be a big difference in whatever result you search for)

1 Like

Thank you! That’s my fault. Missed extra 000
In that case it’s even better than $5!

3 Likes

Looks like it’s only 10 times more than AWS S3 in my region. Cool!

1 Like

What if my query call loops forever? What if these calls are CPU-heavy?

Since there is no cycles consumption during query calls, is it safe?

1 Like

Thanks for the question. @diegop tagged me to answer it. My name is Akhi and I am the engineering manager for the execution team which built the bulk of the query handling mechanism.

We currently do not charge for queries however we do have mechanisms to limit how many resources are consumed by them.

  • Each message execution has an upper limit on how many instructions it can consume. If a message execution is done before the limit is reached, then the message is declared as failed.
  • On top of that, a given canister can only consume so many instructions executing queries per node on the subnet over a time period. This makes sure that a given canister does not execute too many queries.
  • Next we have rate limiting on the http_handler (the component that handles the http requests from users and forwards queries to execution). If the system / http_handler is under too much load, then this component starts to reject new http requests from the user.

I hope that this helps answer your question above. Please let me know if you have further questions.

4 Likes

Thanks, it helped a lot.
This means, that it is actually useful to optimize queries as well.

Yes, absolutely! And in future we will also start charging for queries so there is that incentive as well.

2 Likes