Docker dockerd swarm high CPU usage cause solution

If you have swarm services and dockerd is creating a high load even with the containers just being idle, the easiest solution is to upgrade to a newer docker version.

For example an identical config of 3 nodes, with Redis 5 with 30 replicas produces a load of about 1.45 in Debian 10 with Docker 18.09.1

If I create the same setup on Debian 11, with Docker 20.10.5+dfsg1 then the CPU usage is low.

One other difference I wondered is the kernel.  In my test setup Debian 10 has kernel linux-image-4.19.0-25-amd64, while Debian 11 has linux-image-5.10.0-11-amd64.

To see if it is some major difference caused between Kernel 4.19 and 5.10 (though I doubted this was the issue), I installed the latest kernel 5.10 in Debian 10 linux-image-5.10.0-0.deb10.26-amd64 on all nodes.  There was no difference at all between 4.19 and 5.10 kernels, so the issue seems to solely be based on an issue that exists in Docker 18.09.01 (or at least how it was compiled for Debian 10) vs the Debian 11's Docker  20.10.5

It's easy enough to upgrade your Debian 10 to 11 if you need to (I prefer Debian 10 for teseting due to it's smaller footprint over 11).

Debian 11 Docker Info:

root@Deb11Docker02:~# docker version
Client:
 Version:           20.10.5+dfsg1
 API version:       1.41
 Go version:        go1.15.15
 Git commit:        55c4c88
 Built:             Mon May 30 18:34:49 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.5+dfsg1
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.15.15
  Git commit:       363e9a8
  Built:            Mon May 30 18:34:49 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.13~ds1
  GitCommit:        1.4.13~ds1-1~deb11u4
 runc:
  Version:          1.0.0~rc93+ds1
  GitCommit:        1.0.0~rc93+ds1-5+deb11u2
 docker-init:
  Version:          0.19.0
  GitCommit:        

 

Debian 10 Docker Info:

Client:
 Version:           18.09.1
 API version:       1.39
 Go version:        go1.11.6
 Git commit:        4c52b90
 Built:             Sun, 21 Feb 2021 18:18:35 +0100
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.09.1
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.11.6
  Git commit:       4c52b90
  Built:            Sun Feb 21 17:18:35 2021
  OS/Arch:          linux/amd64
  Experimental:     false


Tags:

docker, dockerd, swarm, cpu, usage, solutionif, creating, containers, idle, easiest, upgrade, newer, identical, config, nodes, redis, replicas, produces, debian, dfsg, kernel, linux, amd, installed, deb, info, api, git, os, context, default, experimental, server, containerd, ds, gitcommit, runc, rc, init, feb,

Latest Articles

  • FreePBX 17 How To Add a Trunk
  • Docker Container Onboot Policy - How to make sure a container is always running
  • FreePBX 17 How To Add Phones / Extensions and Register
  • Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes. solution
  • Cisco How To Use a Third Party SIP Phone (eg. Avaya, 3CX)
  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX 17 in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide
  • Linux Ubuntu Redhat How To Extract Images from PDF
  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format
  • Using Cisco CME Router with Asterisk as a dial-peer
  • Cisco CME How To Configure SIP Trunk VOIP
  • Virtualbox host Only Network Error Failed to save host network interface parameter - Cannot change gateway IP of host only network
  • Cisco CME and C7200 Router Testing and Learning Environment on Ubuntu 20+ Setup Tutorial Guide
  • Abusive IP ranges blacklist