podman: Running "podman images -a" is very slow
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Running the podman images -a command takes a very long time. With just two images, it takes several seconds and the time seems to scale with the amount of images on the system. I found this with https://github.com/containers/toolbox/issues/1027 first and have now replicated with podman 4.0.3 on Fedora 36 beta.
Steps to reproduce the issue:
- Set up any podman image. Doesn’t seem to matter much which.
- Run
time podman images -a - Notice that it takes a very long time.
Describe the results you received: On a machine with many images, it takes 35 seconds.
[jacob@localhost-live rymdport]$ time podman images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/fyneio/fyne-cross 1.2-darwin 22f47e0d0137 About an hour ago 2.55 GB
<none> <none> b2d5ef4f323f About an hour ago 2 GB
<none> <none> b2f1fc3874ed About an hour ago 3.46 GB
<none> <none> 91b03921050c 2 hours ago 2.52 GB
<none> <none> 48a3814b4359 2 hours ago 2.42 GB
<none> <none> 5e5ad8cf4a6b 2 hours ago 2.42 GB
<none> <none> 5e7cbbd1de19 2 hours ago 2.28 GB
<none> <none> 0ccf8a18e406 2 hours ago 2.28 GB
<none> <none> 4381387f0afd 2 hours ago 2.28 GB
<none> <none> b2b404b3f1cb 2 hours ago 1.54 GB
<none> <none> 097b75dd137e 2 hours ago 1.42 GB
<none> <none> 3a88c2b6994b 2 hours ago 1.42 GB
docker.io/fyneio/fyne-cross 1.2-windows ef3940cf2de7 4 weeks ago 2.21 GB
docker.io/fyneio/fyne-cross 1.2-linux-arm64 45e79a9fa5d8 4 weeks ago 2.09 GB
docker.io/fyneio/fyne-cross 1.2-freebsd-arm64 5099e4221a66 4 weeks ago 4.17 GB
docker.io/fyneio/fyne-cross 1.2-freebsd-amd64 2befa59f85b3 4 weeks ago 4.26 GB
docker.io/fyneio/fyne-cross 1.2-base-llvm e2d717b27fa9 4 weeks ago 1.42 GB
docker.io/fyneio/fyne-cross 1.2-base b5fdf9337367 4 weeks ago 1.11 GB
real 0m35.463s
user 0m9.358s
sys 0m19.979s
Describe the results you expected: Something that is a lot faster. Definitely less than or around a second.
Additional information you deem important (e.g. issue happens only occasionally): See https://github.com/containers/toolbox/issues/1027. There is a lot of information there.
Output of podman version:
Client: Podman Engine
Version: 4.0.3
API Version: 4.0.3
Go Version: go1.18
Built: Fri Apr 1 20:21:54 2022
OS/Arch: linux/amd64
Output of podman info --debug:
host:
arch: amd64
buildahVersion: 1.24.3
cgroupControllers:
- cpu
- io
- memory
- pids
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: conmon-2.1.0-2.fc36.x86_64
path: /usr/bin/conmon
version: 'conmon version 2.1.0, commit: '
cpus: 8
distribution:
distribution: fedora
variant: workstation
version: "36"
eventLogger: journald
hostname: localhost-live.lan
idMappings:
gidmap:
- container_id: 0
host_id: 1000
size: 1
- container_id: 1
host_id: 100000
size: 65536
uidmap:
- container_id: 0
host_id: 1000
size: 1
- container_id: 1
host_id: 100000
size: 65536
kernel: 5.17.1-300.fc36.x86_64
linkmode: dynamic
logDriver: journald
memFree: 286789632
memTotal: 16731807744
networkBackend: netavark
ociRuntime:
name: crun
package: crun-1.4.4-1.fc36.x86_64
path: /usr/bin/crun
version: |-
crun version 1.4.4
commit: 6521fcc5806f20f6187eb933f9f45130c86da230
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
os: linux
remoteSocket:
path: /run/user/1000/podman/podman.sock
security:
apparmorEnabled: false
capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
rootless: true
seccompEnabled: true
seccompProfilePath: /usr/share/containers/seccomp.json
selinuxEnabled: true
serviceIsRemote: false
slirp4netns:
executable: /usr/bin/slirp4netns
package: slirp4netns-1.2.0-0.2.beta.0.fc36.x86_64
version: |-
slirp4netns version 1.2.0-beta.0
commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
libslirp: 4.6.1
SLIRP_CONFIG_VERSION_MAX: 3
libseccomp: 2.5.3
swapFree: 8097624064
swapTotal: 8589930496
uptime: 2h 11m 30.82s (Approximately 0.08 days)
plugins:
log:
- k8s-file
- none
- passthrough
- journald
network:
- bridge
- macvlan
volume:
- local
registries:
search:
- registry.fedoraproject.org
- registry.access.redhat.com
- docker.io
- quay.io
store:
configFile: /home/jacob/.config/containers/storage.conf
containerStore:
number: 0
paused: 0
running: 0
stopped: 0
graphDriverName: overlay
graphOptions: {}
graphRoot: /home/jacob/.local/share/containers/storage
graphStatus:
Backing Filesystem: btrfs
Native Overlay Diff: "true"
Supports d_type: "true"
Using metacopy: "false"
imageCopyTmpDir: /var/tmp
imageStore:
number: 18
runRoot: /run/user/1000/containers
volumePath: /home/jacob/.local/share/containers/storage/volumes
version:
APIVersion: 4.0.3
Built: 1648837314
BuiltTime: Fri Apr 1 20:21:54 2022
GitCommit: ""
GoVersion: go1.18
OsArch: linux/amd64
Version: 4.0.3
Package info (e.g. output of rpm -q podman or apt list podman):
podman-4.0.3-1.fc36.x86_64
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.): On hardware, no virtual machines. The testing in this issue was created using a desktop workstation with 16GB RAM, an i7 3770 and a spinning 1TB HDD. Testing on https://github.com/containers/toolbox/issues/1027 was done on a Dell Latitude 7490 laptop with 16GB RAM, an i5 8250U and a 500GB SATA M.2 SSD (which basically says that slow drives isn’t the problem here).
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (10 by maintainers)
Commits related to this issue
- images --size Add a --size option to podman images to allow for disabling computing the size of listed images. If listing images is critical to performance, user may chose to turn off size computati... — committed to vrothberg/libpod by vrothberg 2 years ago
- images --size Add a --size option to podman images to allow for disabling computing the size of listed images. If listing images is critical to performance, user may chose to turn off size computati... — committed to vrothberg/libpod by vrothberg 2 years ago
- images --size Add a --size option to podman images to allow for disabling computing the size of listed images. If listing images is critical to performance, user may chose to turn off size computati... — committed to vrothberg/libpod by vrothberg 2 years ago
- images --size Add a --size option to podman images to allow for disabling computing the size of listed images. If listing images is critical to performance, user may chose to turn off size computati... — committed to gbraad-redhat/podman by vrothberg 2 years ago
Thanks, @Jacalz!
I opened https://github.com/containers/podman/pull/13810 to add a
--sizeflag topodman imagesthat can be turned off by the user.@giuseppe, did we ever consider/discuss computing the size of an image once at commit time and just return that?