-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overlay: Diffsize: avoid naive diff #1688
Conversation
Computing the diff size for the rootful overlay storage driver used the naive diff. The reasoning was that we have made use of rootful copy-up. The downside is a mind-blowing performance penalty in comparison to the rootless case. Hence, drop the naive diff and only compute the size of the directory which is absolutely sufficient for the motivating use case of podman-system-df. This drops the execution of system-df from 19.3s to 0.11s listing 5 containers and 1 image. Fixes: github.com/containers/podman/issues/19467 Signed-off-by: Giuseppe Scrivano <[email protected]> Signed-off-by: Valentin Rothberg <[email protected]>
f4d04de
to
7618ac8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
that is the patch I've suggested in containers/podman#19467 (comment) so I am fine with this approach |
@@ -2162,10 +2162,6 @@ func (d *Driver) getLowerDiffPaths(id string) ([]string, error) { | |||
// and its parent and returns the size in bytes of the changes | |||
// relative to its base filesystem directory. | |||
func (d *Driver) DiffSize(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) (size int64, err error) { | |||
if d.options.mountProgram == "" && (d.useNaiveDiff() || !d.isParent(id, parent)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A random drive-by: Is it really correct to drop the special handling of !d.isParent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I think it doesn't matter for the current callers but we probably should do a naive diff if it's not the parent.
@giuseppe WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I also think we should do the naive diff in this case.
Thanks @mtrmac for spotting it
Computing the diff size for the rootful overlay storage driver used the naive diff. The reasoning was that we have made use of rootful copy-up. The downside is a mind-blowing performance penalty in comparison to the rootless case.
Hence, drop the naive diff and only compute the size of the directory which is absolutely sufficient for the motivating use case of podman-system-df. This drops the execution of system-df from 19.3s to 0.11s listing 5 containers and 1 image.
Fixes: github.com/containers/podman/issues/19467