Skip to content

Commit

Permalink
Merge pull request #3642 from dfinity/cycles-reservation
Browse files Browse the repository at this point in the history
add: cycles reservation info
  • Loading branch information
jessiemongeon1 authored Oct 24, 2024
2 parents 2db7388 + 95770c6 commit 4f8b771
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/developer-docs/gas-cost.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ Note that query messages are currently free, but this may change in the future.

To handle an incoming message or task such as a timer or heartbeat, the canister executes the function specified in the message.

ICP reserves cycles to execute the message's response callback or cleanup. The amount reserved is equivalent to the amount that would be needed for maximum execution. For example, a DTS execution of 40B instructions on a 13-node subnet would reserve 16B cycles. From this reservation, 5% is reserved for the cleanup callback. The cleanup callback can hit the 5% limit, though it is not expected.

By default, canisters are scheduled for execution in a "best-effort" manner. Canisters that require guaranteed execution can get a share of compute capacity by setting `compute_allocation` in their canister settings. Compute allocation is expressed in percents and denotes the percentage of an execution core reserved for the canister.

Setting even 1% compute allocation provides a significant advantage over canisters that use the "best-effort" scheduling:
Expand Down

0 comments on commit 4f8b771

Please sign in to comment.