compose: [BUG] Severe performance degradation of all commands with versions >=2.24.4 (incl. 2.25.0)
Description
Starting with version 2.24.4 I observe a noticeable and severe performance degradation with all docker compose commands.
We have a pretty sizable project with over 100 containers, in case that helps paint a better picture.
Steps To Reproduce
A big project with all containers stopped (assuming that even matters).
For versions <= 2.24.3
$ time docker compose ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
real 0m0.423s
user 0m0.478s
sys 0m0.134s
With version >= 2.24.4:
$ time docker compose ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
real 0m8.815s
user 0m13.045s
sys 0m0.358s
The delay (~8s) is observed before any output is produced and regardless of which command is ran. I cannot reproduce the slowness with a simple test project of a couple of containers.
Happy to provide more information that can help hunt this down.
Compose Version
Docker Compose version v2.24.4
Docker Compose version v2.24.5
Docker Compose version v2.24.6
Docker Compose version v2.24.7
Docker Compose version v2.25.0
Docker Environment
Client:
Version: 24.0.7
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: 0.12.0
Path: /usr/lib/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.24.3
Path: /home/xxx/.docker/cli-plugins/docker-compose
Server:
Containers: 2121
Running: 1
Paused: 0
Stopped: 2120
Images: 910
Server Version: 24.0.7
Storage Driver: overlay2
Backing Filesystem: btrfs
Supports d_type: true
Using metacopy: true
Native Overlay Diff: false
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: 64b8a811b07ba6288238eefc14d898ee0b5b99ba.m
runc version:
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.1.71-1
Operating System: xxx
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 31.01GiB
Name: xxx
ID: xxx
Docker Root Dir: /var/lib/docker
Debug Mode: false
Username: xxx
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Anything else?
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 26 (5 by maintainers)
The issue has been introduced by the change: https://github.com/compose-spec/compose-go/pull/546
It can be reproduced with this compose.yaml file.
Running
docker compose configon my machine takes withI created the custom 2.25.0 build without https://github.com/compose-spec/compose-go/pull/546 in the following way:
go mod vendorgo build -o compose cmd/main.goYeah 🎉 Thanks @ndeloof for taking care of this when I was away 🙏🤗
I can confirm removing this check has a mass impact on performance. There’s something wrong with
InDependencyOrderimplementation, I’ll look into it@glours I can confirm the correct version is being used:
Hey @nocive @dave-shawley Can both of you share the result of
docker compose version? I wanted to be sure you don’t have a old version of Compose taking precedence to the latest one installed becausedocker infotell you the version of the detected Compose plugin but there is not guarantee this is the Compose binary that will be used. To let you know, I tried to reproduce on my Mac M1 with Desktop in both admin/non-admin mode and with an Unbuntu 23.10 VM without any successping @glours @ndeloof
FWIW I’m seeing the same behavior with v2.24.3-desktop.1 and v2.24.6 on an Apple M2 laptop
This is reproducible with a simple compose.yaml and any docker compose sub-command. The following
docker compose configtook 8 seconds. The interesting thing is that it seems to be sleeping or doing whatever it is up to after the output is printed.