# Out of cycles, despite I specified a giant amount of cycles

**URL:** <https://forum.dfinity.org/t/out-of-cycles-despite-i-specified-a-giant-amount-of-cycles/21694>\
**Category:** CDK\
**Created:** [July 25, 2023, 4:00pm UTC](https://forum.dfinity.org/t/out-of-cycles-despite-i-specified-a-giant-amount-of-cycles/21694 "2023-07-25T16:00:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [July 25, 2023, 4:00pm UTC](https://forum.dfinity.org/t/out-of-cycles-despite-i-specified-a-giant-amount-of-cycles/21694/1 "2023-07-25T16:00:29Z")

</div>

I specified a giant amount of cycles (for local testing) for `stresser` canister:

```json
{
    "canisters": {
      "stresser": {
        "main": "motoko/main.mo",
        "type": "motoko",
        "cycles": 100000000000000000
      },
      ...

```

Nevertheless, when I run it, cycles are not enough. What is my error?

```auto
$ make
dfx deploy stresser --with-cycles 99000000000000000
Deploying: stresser
Creating a wallet canister on the local network.
The wallet canister on the "local" network for user "default" is "bnz7o-iuaaa-aaaaa-qaaaa-cai"
Creating canisters...
Creating canister stresser...
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed while trying to register all canisters.
    Failed to create canister 'stresser'.
      The replica returned a replica error: Replica Error: reject code CanisterError, reject message Canister bnz7o-iuaaa-aaaaa-qaaaa-cai is out of cycles: requested 99_000_000_000_000_000 cycles but the available balance is 99_998_729_277_381 cycles and the freezing threshold 173_237_730 cycles, error code None

```

A typical fragment of code of `stresser` canister:

```auto
Cycles.add(1_000_000_000_000);
await options.index.createSubDB({guid; dbOptions; userData = ""});

```

---

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [July 25, 2023, 4:42pm UTC](https://forum.dfinity.org/t/out-of-cycles-despite-i-specified-a-giant-amount-of-cycles/21694/2 "2023-07-25T16:42:16Z")

</div>

My question, put short: How do I increase the amount of cycles that I can use (in local deployment)?

---

<div class="post-metadata">

**Author:** ![domwoe](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/domwoe/32/5165_2.png) [@domwoe](https://forum.dfinity.org/u/domwoe)\
**Post date:** [July 25, 2023, 6:15pm UTC](https://forum.dfinity.org/t/out-of-cycles-despite-i-specified-a-giant-amount-of-cycles/21694/3 "2023-07-25T18:15:01Z")

</div>

> **[dfx ledger | Internet Computer](https://internetcomputer.org/docs/current/references/cli-reference/dfx-ledger/#dfx-ledger-fabricate-cycles)**
>
> Use the dfx ledger command to interact with the ledger canister.

---

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [July 25, 2023, 6:30pm UTC](https://forum.dfinity.org/t/out-of-cycles-despite-i-specified-a-giant-amount-of-cycles/21694/4 "2023-07-25T18:30:49Z")

</div>

OK, but **why** my configuration with `"cycles"` in `dfx.json` didn’t work?

---

<div class="post-metadata">

**Author:** ![domwoe](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/domwoe/32/5165_2.png) [@domwoe](https://forum.dfinity.org/u/domwoe)\
**Post date:** [July 25, 2023, 6:33pm UTC](https://forum.dfinity.org/t/out-of-cycles-despite-i-specified-a-giant-amount-of-cycles/21694/5 "2023-07-25T18:33:46Z")

</div>

Is this even a valid property?

I can’t find it in the reference [Internet Computer Loading](https://internetcomputer.org/docs/current/references/dfx-json-reference)
