1

Good day, everyone! Can somebody explain how I can calculate or forecast of my contract CPU usage in mainnet on some period? I want to understand the process of identification the factors that define real values of cpu bandwith in the future.

3
  • pretty much impossible at the moment.. just a few days the wasm interpreted was updated to work 2x faster so any CPU calculations before that were invalidated. similar things may happen in the future or if BPs upgrade their machines
    – confused00
    Commented Sep 27, 2018 at 22:27
  • @confused00 when will the new interpreter coming?
    – Jimmy Guo
    Commented Sep 28, 2018 at 5:51
  • @JimmyGuo it already did in v1.3.0 github.com/EOSIO/eos/releases/tag/v1.3.0
    – confused00
    Commented Sep 28, 2018 at 13:47

2 Answers 2

0

As far as i know, You cannot calculate exactly CPU usage. With the same transaction will have different cost depending on BPs and network condition.

But you can forecast your CPU usage in smart contract by estimate how many transactions and how much does it costs for these transactions.

Example: You Dapp will have 100 transaction/day, CPU usage average ~ 1ms/transaction. --> This mean, you need 100ms CPU/day

More detail, you can refer here https://medium.com/leclevietnam/eos-resource-allocation-98bb6cb84497

1

You can now estimate your costs for a transaction by using EOS New York's EOS Charge.

Methodology:

There is a MongoDB query that runs hourly. This query averages the CPU and NET resource costs experienced for every action performed on the EOS Mainnet within the last 100,000 blocks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.