Skip to content

Partial Images Feature is slower than not using it #1928

Open
@antheas

Description

@antheas

Issue Description

Hi, since we're hearing a lot about the zstd:chunked encoding, I ran some tests today, and across the board it appears that the partial images feature is 2-3x slower, regardless of the cached amount (although the tests do not show partially cached layers; it was tested).

When the partial images feature is on, under a registry and client that have more than ~100mbps of bandwidth, image pulling with the partial mages feature is 2-3x slower. Its closer to 2x slower when compared to zstd:chunked with the feature turned off and 3x slower compared to gzip'd layers.

Steps to reproduce the issue

I ran the following with a 1gbps connection (as confirmed by speedtest.net ~900mbps) from github with a ping of 19ms, saved to a gen 4 nvme ssd, backed with a 7840U class AMD CPU (8c/16t/16GB RAM).

# Without partial images
# enable_partial_images="false"
podman system prune -a
time podman run -it --rm ghcr.io/castrojo/bluefin:40-20240522 ls
# 54.45s user 36.50s system 193% cpu 47.015 total
time podman run -it --rm ghcr.io/castrojo/bluefin-dx:40-20240522 ls
# 32.62s user 18.76s system 69% cpu 1:14.38 total

# Downloading the large image on its own (!!!)
podman system prune -a
podman run -it --rm ghcr.io/castrojo/bluefin-dx:40-20240522 ls 
# 74.91s user 46.67s system 159% cpu 1:16.46 total

# With partial pulls
# enable_partial_images="true"
podman system prune -a
time podman run -it --rm ghcr.io/castrojo/bluefin:40-20240522 ls 
# 34.64s user 30.79s system 59% cpu 1:50.81 total
time podman run -it --rm ghcr.io/castrojo/bluefin-dx:40-20240522 ls 
# 19.51s user 17.06s system 22% cpu 2:40.20 total

For context, the image bluefin-dx extends bluefin with 2 layers, each 1GB (total 2GB).

REPOSITORY                   TAG          IMAGE ID      CREATED      SIZE
ghcr.io/castrojo/bluefin-dx  40-20240522  2ed1c6dd4200  4 hours ago  10.6 GB
ghcr.io/castrojo/bluefin     40-20240522  f7d19966c0e1  4 hours ago  7.09 GB

Describe the results you received

Across dozens of tests, downloading zstd:chunked images is 2-3x slower regardless of the cached amount. This is when using the same image, compressed the same way, just by turning off the partial images feature.

Describe the results you expected

zstd:chunked images pulled with partial images set to true should have 90% to 100% of the speed of not using the feature. If there is cache, they should be 2-3x faster (depending on cached files).

podman info output

host:
  arch: amd64
  buildahVersion: 1.35.4
  cgroupControllers:
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: /usr/bin/conmon is owned by conmon 1:2.1.12-1
    path: /usr/bin/conmon
    version: 'conmon version 2.1.12, commit: e8896631295ccb0bfdda4284f1751be19b483264'
  cpuUtilization:
    idlePercent: 93.47
    systemPercent: 1.75
    userPercent: 4.78
  cpus: 16
  databaseBackend: sqlite
  distribution:
    distribution: ...
    version: unknown
  eventLogger: journald
  freeLocks: 2048
  hostname: antheas-go
  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: 6.6.30-...
  linkmode: dynamic
  logDriver: journald
  memFree: 1024684032
  memTotal: 15910768640
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: Unknown
    package: /usr/lib/podman/netavark is owned by netavark 1.10.3-1
    path: /usr/lib/podman/netavark
    version: netavark 1.10.3
  ociRuntime:
    name: crun
    package: /usr/bin/crun is owned by crun 1.15-1
    path: /usr/bin/crun
    version: |-
      crun version 1.15
      commit: e6eacaf4034e84185fd8780ac9262bbf57082278
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: /usr/bin/pasta is owned by passt 2024_05_10.7288448-1
    version: |
      pasta 2024_05_10.7288448
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: false
    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: /etc/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: /usr/bin/slirp4netns is owned by slirp4netns 1.3.1-1
    version: |-
      slirp4netns version 1.3.1
      commit: e5e368c4f5db6ae75c2fce786e31eef9da6bf236
      libslirp: 4.8.0
      SLIRP_CONFIG_VERSION_MAX: 5
      libseccomp: 2.5.5
  swapFree: 11512954880
  swapTotal: 18253606912
  uptime: 116h 41m 48.00s (Approximately 4.83 days)
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries: {}
store:
    ...
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/dev/.local/share/containers/storage
  graphRootAllocated: 383876333568
  graphRootUsed: 272384294912
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 2
    ...
version:
  APIVersion: 5.0.3
  Built: 1715595915
  BuiltTime: Mon May 13 12:25:15 2024
  GitCommit: d08315df35cb6e95f65bf3935f529295c6e54742-dirty
  GoVersion: go1.22.3
  Os: linux
  OsArch: linux/amd64
  Version: 5.0.3

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

No response

Additional information

It seems that the partial images feature is not able to saturate a fast internet connection. This is unlike the stock behavior of podman, which can. Here are some network screens of downloading the same image without a cache (not the one above; same image both cases; cache was reset between screenshots).

Stock podman (finishes within 40s and fits within graph)
image

Partial Images Feature (took 108s so is truncated)
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions