Skip to content
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

storage.conf should be cached #1403

Closed
vrothberg opened this issue Oct 20, 2022 · 1 comment · Fixed by #1404
Closed

storage.conf should be cached #1403

vrothberg opened this issue Oct 20, 2022 · 1 comment · Fixed by #1404

Comments

@vrothberg
Copy link
Member

The below strace suggests that storage.conf should be cached. We are already doing that for registries.conf. The idea for registries.conf was to cache directly in the package to prevent users from having to take care of caching. SIGHUB can be used to trigger reloads (as done with cri-o).

podman (main) $ sudo strace -fff ./bin/podman run --rm docker.io/library/alpine:latest true 2>&1 | grep storage.conf
[pid 14296] newfstatat(AT_FDCWD, "/etc/containers/storage.conf", 0xc0000ad148, 0) = -1 ENOENT (No such file or directory)
[pid 14296] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14296] openat(AT_FDCWD, "/usr/share/containers/storage.conf", O_RDONLY|O_CLOEXEC) = 3
[pid 14296] read(3, "ers/storage.conf (If XDG_CONFIG_"..., 384) = 384
[pid 14296] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf",  <unfinished ...>
[pid 14296] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14296] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14296] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14296] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf",  <unfinished ...>
[pid 14296] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14303] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14303] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14302] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14302] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14418] newfstatat(AT_FDCWD, "/etc/containers/storage.conf",  <unfinished ...>
[pid 14418] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14418] openat(AT_FDCWD, "/usr/share/containers/storage.conf", O_RDONLY|O_CLOEXEC) = 3
[pid 14418] read(3, "ers/storage.conf (If XDG_CONFIG_"..., 384) = 384
[pid 14418] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14418] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14418] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14418] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14418] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14418] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14418] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf",  <unfinished ...>
[pid 14418] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14418] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf",  <unfinished ...>
[pid 14418] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf",  <unfinished ...>
[pid 14429] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf", {st_mode=S_IFREG|0644, st_size=9976, ...}, 0) = 0
[pid 14429] newfstatat(AT_FDCWD, "/usr/share/containers/storage.conf",  <unfinished ...>
@vrothberg
Copy link
Member Author

@rhatdan @baude FYI

rhatdan added a commit to rhatdan/storage that referenced this issue Oct 20, 2022
Currently running a simple container runs and stats configuration
storage.conf files multiple times on a simple container run.

This PR cuts the opens and stats in half by caching the first read.
This speeds up start by about 10-20 microseconds.

If container engines want to react to storage files changing, added a
new function UpdateStoreOptions to allow engines to reload options.

Fixes: containers#1403

Signed-off-by: Daniel J Walsh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant