containerd / nerdctl

contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snapshotter Stat and Usage calls are likely expensive and should be cached when dealing with many objects

apostasie opened this issue · comments

What is the problem you're trying to solve

Currently, whenever we list images (or containers), we are calling on snapshotter.Stat and snapshotter.Usage for every single layer.

This is likely a costly operation, that is also implementation dependent.

Potentially, there might be a lot of shared resources between images (eg: if they use the same base image for example).

This is related to #809 - albeit the benefits of a solution here would apply solely in cases where there is "duplication".

Describe the solution you'd like

Our suggestion is to have a caching mechanism that implements the Snapshotter interface and can be used interchangeably.

PR coming soon.

Additional context

No response

Fixed by #3029