Excessive Cycle Usage on SNS Index Canister

,

Hey there - we’ve noticed that our SNS Index canister is consuming cycles at a rate that’s costing us around $100 every 10 days, which adds up to nearly $4,000 annually.

That’s a significant outlay for a single canister. Do you have any ideas on how we might reduce this usage or optimize the setup? Open to any suggestions - this level of spend doesn’t feel sustainable.

1 Like

I remember in one of the R&Ds 2-3 months ago they presented a tool which could show you which functions or code lines consume most cycles and where you could optimize the codebase, thought it was already in DFX but I’m not sure, would need to rewatch the RND to check it out, but we could do a analysis of the canister code with that tool and see which functions use the most cycles

Maybe that an idea ?

Will take a look but we don’t think we touch the canister in our code, so this looks to be background NNS activity?

Which of the SNSs is that?

It’s the Nuance SNS - token NUA

Taco Dao’s SNS infra canisters have run pretty hot as well, would love to know of any analysis tools out there

sns root

sns gov

sns ledger

sns index

swap and archive are negligible

about 198TC/$330 for ~1 month, not including our 14 custom dapp canisters, which all burn about 0.1 to 3TC a month minus two heaver-lifters that burned 43TC and 7TC last month (call it 60TC for dapp canisters per month)

not as bad as Nuance’s, but majority of our hosting costs go to SNS infra cans, all ears for analysis tools

2 Likes

Nuance SNS - token NUA

Hello,

The canister index costs are (most likely) due to regularly polling for new transactions (I don’t know the parameters for SNSs but that could be as much as twice/second). That would yield a base cost of at least: 3 x 2 x 10 x 24 x 3600 x 5Mil instructions in 10 days. (The first multiplier comes from the timer implementation: there are three message executions per timer call, afaik. The last multiplier is the base cost of a message execution).

One way to deal with it would be to reduce the polling interval (not sure how it can be done on SNS managed indexes though, and if the implied delayed in updating transaction information would be acceptable for wallets).

An option that we have discussed (but didn’t get to implement due to other priorities) is to switch the index from a poll based to a push based model.

3 Likes

Thanks for the response, will discuss with our devs

1 Like

How can I reduce the polling frequency on the SNS Index Canister - I’ve looked into this but it does not look to be possible - any ideas?

Maybe it’s the subnet? TENDY index canister is running super hot burning a tcycle a day.