ic icon indicating copy to clipboard operation
ic copied to clipboard

feat: EXC-1754 Change the way evict_sandbox_processes works

Open dragoljub-djuric opened this issue 1 year ago • 0 comments

When the canister is executed, it is most likely its Sandbox will not be evicted from the cache, since we are keeping Sandboxes based using LRU logic. At the same time, the Scheduler decreases its priority so it is less likely that it will be executed. So our caching of Sandbox processes is almost the worst possible.

Solution: Propagate Scheduler priorities for the place we evict Sandbox processes and do evictions based on the lowest priority. That change should decrease the number of cache misses.

Link to follow-up with minimized number of reads to scheduler priorities.

Note: Furthermore: the scheduler priorities used are from the round before the current round, because the snapshots are saved only at the end of the round, and apply_scheduling_strategy() is run before executing canisters in the round. But that should not influence results by a lot.

It remains to explore if there is an easy way to move apply_scheduling_strategy() after all canisters are executed in the round. In that case, priorities taken from the last snapshot will be exactly the priorities for the current round.

dragoljub-djuric avatar Oct 10 '24 14:10 dragoljub-djuric