How to resolve CPU resource or memory resource shortage?

It depends on how much you need.

The heap is currently probably the hardest one. I don’t really have good ideas for that. Sometimes you can write more to stable memory so you don’t keep as much data on the heap

Stable memory capacity is slowly growing, for now it’s at 64GB. If that’s not enough for you, you probably have to scale out to multiple canisters

The instruction limit is also pretty hard to work around. There the only options are to optimise your code, which is hard and often has limited reach. The other one is to split your functions up and do self-calls, since after every await the instruction counter is reset

For the volume of requests you again have to scale out to multiple canisters or shift to more query calls. Canisters are single-threaded for update calls. For queries every node can respond on its own without blocking other nodes from responding

1 Like