Skip to content

Commit 52f0c21

Browse files
authored
docs: add resource-limits page, rename cycles-costs to cycle-costs (#267)
## Summary - Adds `docs/references/resource-limits.md` as a dedicated reference page, separated from cycle costs (different reader intent: execution constraints vs. billing) - Renames `references/cycles-costs.md` → `references/cycle-costs.md` and fixes the title to "Cycle costs" (natural English compound noun, consistent with the page's own description) - Removes the condensed resource limits table from `cycle-costs.md`; replaces it with a cross-reference to the new page - Updates all 16 inbound links across 19 files; links in `execution-errors.md` and `ic-interface-spec/canister-interface.md` that were pointing to limit-related content now point to `resource-limits.md` with proper section anchors (`#message-limits`, `#memory-limits`) - Adds `resource-limits` sidebar entry between `cycle-costs` and `subnet-types` **Resource limits page coverage** (ported from dfinity/portal `docs/building-apps/canister-management/resource-limits.mdx`, which the portal placed as a standalone page under canister-management): - Message limits - Instruction limits - Memory limits (including stable memory per-message access limits) - Wasm module limits - Subnet limits - Execution thread limits - Canister environment variables - Performance characteristics (prose) - Additional notes: ingress expiration, Wasm validation rules ## Sync recommendation `informed by dfinity/portal docs/building-apps/canister-management/resource-limits.mdx` — hand-maintained going forward; upstream tables should be cross-checked against the IC interface spec on spec version bumps.
1 parent dd4abaf commit 52f0c21

19 files changed

Lines changed: 143 additions & 56 deletions

‎docs/concepts/chain-key-cryptography.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ The following master keys are deployed at the time of writing. The Network Nervo
9898

9999
Test keys are available for development and run on smaller subnets with lower signing costs. They should not be used for anything of value. Production keys run on high-replication subnets (34+ nodes) for stronger security guarantees. Each key is also reshared to a backup subnet for availability: if the signing subnet fails, the backup can take over without generating a new key.
100100

101-
For signing costs, see [Cycles costs](../references/cycles-costs.md).
101+
For signing costs, see [Cycle costs](../references/cycle-costs.md).
102102

103103
## Supported chains
104104

‎docs/concepts/cycles.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The tradeoff is that developers must forecast and fund usage upfront rather than
120120
- [Cycles Management](../guides/canister-management/cycles-management.md): how to check balances, top up canisters, and set freezing thresholds
121121
- [Calls with attached cycles](../guides/canister-calls/inter-canister-calls.md#calls-with-attached-cycles): attach cycles to an inter-canister call and use the proxy canister pattern for the CLI
122122
- [Cycles ledger reference](../references/system-canisters.md#cycles-ledger): canister IDs, interface specification, and CMC integration
123-
- [Cycles Costs Reference](../references/cycles-costs.md): exact cost tables for all operations
123+
- [Cycle costs](../references/cycle-costs.md): exact cost tables for all operations
124124
- [Canisters](./canisters.md): canisters as the paying entity for compute and storage
125125

126126
<!-- Upstream: informed by dfinity/portal docs/building-apps/essentials/gas-cost.mdx, docs/building-apps/getting-started/tokens-and-cycles.mdx; learn hub staging: canister-smart-contracts/cycles.md, canister-smart-contracts/cycles-ledger.md -->

‎docs/concepts/https-outcalls.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The cost depends on two factors:
7676

7777
If you omit `max_response_bytes`, the system assumes the maximum of 2 MB and charges accordingly: roughly 21.5 billion cycles on a 13-node subnet. Always set this to a reasonable upper bound for your expected response to avoid overpaying. Unused cycles are refunded.
7878

79-
For exact pricing formulas, see the [cycles costs reference](../references/cycles-costs.md).
79+
For exact pricing formulas, see the [cycles costs reference](../references/cycle-costs.md).
8080

8181
## Limitations
8282

@@ -110,5 +110,5 @@ One extension is under consideration that may affect architecture decisions:
110110

111111
- [HTTPS outcalls guide](../guides/backends/https-outcalls.md): practical how-to with code examples in Motoko and Rust
112112
- [Chain Fusion: Ethereum integration](../guides/chain-fusion/ethereum.md): uses HTTPS outcalls via the EVM RPC canister
113-
- [Cycles costs reference](../references/cycles-costs.md): detailed pricing formulas
113+
- [Cycles costs reference](../references/cycle-costs.md): detailed pricing formulas
114114
<!-- Upstream: informed by dfinity/portal docs/references/https-outcalls-how-it-works.mdx -->

‎docs/guides/backends/https-outcalls.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ For reference, on a 13-node subnet:
146146
- Per request byte: 5,200 cycles
147147
- Per `max_response_bytes` byte: 10,400 cycles
148148

149-
See [Cycles costs](../../references/cycles-costs.md#https-outcalls) for the full pricing table.
149+
See [Cycles costs](../../references/cycle-costs.md#https-outcalls) for the full pricing table.
150150

151151
## Limitations and pitfalls
152152

@@ -166,6 +166,6 @@ Use the "Full example in ICP Ninja" links above to deploy and test directly in t
166166
- [Management canister reference](../../references/management-canister.md#http_request): full `http_request` parameter reference including all fields
167167
- [Exchange Rate Canister (XRC)](https://github.com/dfinity/exchange-rate-canister): a production service powered by HTTPS outcalls that fetches digital asset and fiat exchange rates
168168
- [Chain Fusion: Ethereum](../chain-fusion/ethereum.md): the EVM RPC canister uses HTTPS outcalls under the hood
169-
- [Cycles costs](../../references/cycles-costs.md#https-outcalls): outcall pricing details
169+
- [Cycles costs](../../references/cycle-costs.md#https-outcalls): outcall pricing details
170170

171171
{/* Upstream: informed by dfinity/portal docs/building-apps/network-features/using-http/https-outcalls/; dfinity/examples send_http_get, send_http_post */}

‎docs/guides/backends/timers.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Timer tasks are added to the canister's input queue. If the canister or subnet i
215215

216216
The canister output queue is limited to 500 messages. This caps how many timers can fire in a single round. The CDK also enforces internal rate limits (250 concurrent timer calls globally, 5 per interval timer).
217217

218-
See [Cycles and costs](../../references/cycles-costs.md#cost-table) for current pricing.
218+
See [Cycles and costs](../../references/cycle-costs.md#cost-table) for current pricing.
219219

220220
## Heartbeats (legacy)
221221

@@ -279,6 +279,6 @@ For a complete working example with cycle tracking and multiple timers:
279279

280280
- [Canister lifecycle](../canister-management/lifecycle.md#what-happens-during-an-upgrade): init, pre/post-upgrade hooks
281281
- [Timers (concept)](../../concepts/timers.md): how the IC protocol timer works
282-
- [Cycles and costs](../../references/cycles-costs.md#cost-table): current pricing
282+
- [Cycles and costs](../../references/cycle-costs.md#cost-table): current pricing
283283

284284
{/* Upstream: informed by dfinity/portal docs/building-apps/network-features/periodic-tasks-timers.mdx, docs/building-apps/network-features/time-and-timestamps.mdx, dfinity/cdk-rs ic-cdk-timers/src/lib.rs, and caffeinelabs/motoko-core src/Timer.mo */}

‎docs/guides/canister-management/cycles-management.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ icp cycles balance -n ic
5757
# Output: ~5T cycles
5858
```
5959

60-
**Budget guidance:** Plan for 1–2T cycles per canister as a starting balance. A simple backend canister with moderate traffic costs roughly 0.1–0.5T cycles per month, though this varies with storage and call volume. See the [cycles costs reference](../../references/cycles-costs.md#cost-table) for per-operation pricing.
60+
**Budget guidance:** Plan for 1–2T cycles per canister as a starting balance. A simple backend canister with moderate traffic costs roughly 0.1–0.5T cycles per month, though this varies with storage and call volume. See the [cycles costs reference](../../references/cycle-costs.md#cost-table) for per-operation pricing.
6161

6262
## Checking canister cycle balances
6363

@@ -370,7 +370,7 @@ icp canister top-up backend --amount 1T -n ic
370370

371371
- [Canister settings](settings.md): Freezing threshold, memory allocation, compute allocation
372372
- [Canister lifecycle](lifecycle.md): Create, install, upgrade, and delete canisters
373-
- [Cycles costs reference](../../references/cycles-costs.md#cost-table): Exact cost tables per operation
373+
- [Cycles costs reference](../../references/cycle-costs.md#cost-table): Exact cost tables per operation
374374
- [Cycles](../../concepts/cycles.md): Why canisters pay for execution and how the cycles ledger works
375375
- [Cycles ledger reference](../../references/system-canisters.md#cycles-ledger): Canister IDs and interface specification
376376
- [Calls with attached cycles](../canister-calls/inter-canister-calls.md#calls-with-attached-cycles): attach cycles to an inter-canister call and accept them in the callee

‎docs/guides/canister-management/optimization.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Most production canisters benefit from combining several techniques:
231231
## Next steps
232232

233233
- [Large Wasm](large-wasm.md): when binary size exceeds the upload limit
234-
- [Cycles costs](../../references/cycles-costs.md): how Wasm size and instruction count map to cycle charges
234+
- [Cycles costs](../../references/cycle-costs.md): how Wasm size and instruction count map to cycle charges
235235
- [Canister lifecycle](lifecycle.md): how optimized builds integrate with the icp-cli deploy workflow
236236

237237
<!-- Upstream: informed by dfinity/portal — docs/building-apps/advanced/optimize/rust.mdx; docs/building-apps/advanced/optimize/motoko.mdx -->

‎docs/guides/canister-management/settings.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ settings:
6969
7070
A value of `50` means the canister gets 50% of an execution core and is scheduled at least every other round. A value of `100` means the canister runs every round.
7171

72-
Compute allocation incurs a rental fee based on time and allocation percentage, regardless of whether the canister actually executes. This increases idle [cycle](../../concepts/cycles.md) consumption. See [cycles costs](../../references/cycles-costs.md#compute-allocation) for pricing details.
72+
Compute allocation incurs a rental fee based on time and allocation percentage, regardless of whether the canister actually executes. This increases idle [cycle](../../concepts/cycles.md) consumption. See [cycles costs](../../references/cycle-costs.md#compute-allocation) for pricing details.
7373

7474
### Memory allocation
7575

@@ -90,7 +90,7 @@ Supported suffixes: `kb` (1,000), `kib` (1,024), `mb` (1,000,000), `mib` (1,048,
9090

9191
When set, the canister draws new Wasm and stable memory from the pre-allocated pool. If usage exceeds the allocation, additional memory is allocated on demand and may fail if the subnet is at capacity.
9292

93-
Like compute allocation, memory allocation incurs a rental fee based on time and allocated amount, regardless of actual usage. See [cycles costs](../../references/cycles-costs.md#storage-reservation) for pricing.
93+
Like compute allocation, memory allocation incurs a rental fee based on time and allocated amount, regardless of actual usage. See [cycles costs](../../references/cycle-costs.md#storage-reservation) for pricing.
9494

9595
### Freezing threshold
9696

@@ -454,7 +454,7 @@ How you configure controllers depends on the trust model for your canister:
454454

455455
- [Canister lifecycle](lifecycle.md): Create, deploy, upgrade, stop, and delete canisters.
456456
- [Cycles management](cycles-management.md): Monitor and top up cycle balances.
457-
- [Cycles costs reference](../../references/cycles-costs.md#compute-allocation): Pricing for compute and memory allocation.
457+
- [Cycles costs reference](../../references/cycle-costs.md#compute-allocation): Pricing for compute and memory allocation.
458458
- [Management canister reference](../../references/management-canister.md): Full interface specification.
459459

460460
{/* Upstream: informed by dfinity/portal (docs/building-apps/canister-management/settings.mdx, docs/building-apps/canister-management/control.mdx, docs/references/_attachments/ic.did (snapshot_visibility field); dfinity/icp-cli) docs/reference/canister-settings.md, docs/reference/cli.md; dfinity/icskills: skills/cycles-management/SKILL.md */}

‎docs/guides/canister-management/subnet-selection.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Subnets enforce a storage reservation policy above 750 GiB of total utilization.
133133

134134
If you expect your canister to use significant storage, check the current utilization of candidate subnets on the [ICP Dashboard](https://dashboard.internetcomputer.org/subnets) before deploying. Choosing a subnet with available headroom avoids unexpected reservation costs as your canister grows.
135135

136-
For details on storage costs and the reservation formula, see [Cycles costs](../../references/cycles-costs.md#storage-reservation).
136+
For details on storage costs and the reservation formula, see [Cycles costs](../../references/cycle-costs.md#storage-reservation).
137137

138138
## Troubleshooting
139139

@@ -152,7 +152,7 @@ Note that any canister ID change means losing access to any threshold signature
152152

153153
## Next steps
154154

155-
- [Cycles costs](../../references/cycles-costs.md#replication-factors): Cost tables and the subnet multiplier formula
155+
- [Cycles costs](../../references/cycle-costs.md#replication-factors): Cost tables and the subnet multiplier formula
156156
- [Subnet types reference](../../references/subnet-types.md): Full reference for all subnet types with node counts and properties
157157
- [Canister snapshots](snapshots.md#example-transferring-state-between-canisters): Download/upload workflow for transferring state to another canister
158158
- [Canister migration](canister-migration.md): Complete workflow for moving a canister to a different subnet, with or without preserving the canister ID

‎docs/guides/security/dos-prevention.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ In a shared resource environment like the Internet Computer, multiple canisters
3030
To mitigate the "noisy neighbor" issue, manage your canister's resource allocation effectively:
3131
* **Memory allocation**: Memory can be reserved per canister by setting `memory_allocation`, ensuring that your canister can always allocate memory up to the requested `memory_allocation` and preventing other canisters from using up the subnet's available memory. Note that memory availability is not guaranteed beyond the memory allocation and thus monitoring actual memory usage against this value is important to avoid availability issues.
3232
* **Compute reservation**: Similar to memory, computing power can also be reserved by setting `compute_allocation` to a value between 0 and 100, which denotes the percentage of one CPU core to be reserved for this canister. A value of 50 means that every 2 rounds, the canister will be scheduled to execute a message. This guarantees the minimal progress your canister can make, which protects against noisy neighbors. Both allocations are reserving resources for your canister on the subnet, which prevents the other canisters from using them. Hence, they come at a cost. Memory allocation is charged as if all that memory would be allocated. Compute allocation is currently charged at 10M cycles per percentage point.
33-
Learn more about managing memory and compute resources in the [cycles costs reference](../../references/cycles-costs.md).
33+
Learn more about managing memory and compute resources in the [cycles costs reference](../../references/cycle-costs.md).
3434
* **Subnet and canister distribution**: Implement a smart canister deployment strategy by monitoring the load on subnets. You can choose to deploy new canisters on less busy subnets or adopt a multi-canister architecture that balances the load across subnets. Be mindful to minimize inter-subnet communication for canisters that frequently interact with each other. Additionally, avoid deploying to known high-traffic subnets where possible, though keep in mind that resource usage can change unexpectedly with new apps.
3535

3636
:::note
@@ -41,7 +41,7 @@ When the subnet grows above 750GiB, then the new reservation mechanism activates
4141

4242
### Security concern
4343

44-
Some calls (update or query) might be expensive in terms of the memory or cycles they consume. For example, any function using chain-key signing or HTTPS outcalls is relatively expensive. See the [cycles costs reference](../../references/cycles-costs.md) for pricing details and a full list of expensive call types.
44+
Some calls (update or query) might be expensive in terms of the memory or cycles they consume. For example, any function using chain-key signing or HTTPS outcalls is relatively expensive. See the [cycles costs reference](../../references/cycle-costs.md) for pricing details and a full list of expensive call types.
4545

4646
An attacker will target expensive calls to drain the cycles balance or available memory quickly.
4747

0 commit comments

Comments
 (0)