sipcapture / homer7-docker

HOMER 7 Docker Images
93 stars 87 forks source link

Very high idle CPU usage (hom7-prom-all) #83

Closed jonastelzio closed 3 years ago

jonastelzio commented 4 years ago

Hey there!

Just installed Homer 7.7 with the docker image - man that is awesome! I've installed it on AWS on a t3.medium instance, using these exact commands:

    1  sudo yum update -y
    2  sudo amazon-linux-extras install docker -y
    3  sudo service docker start
    4  sudo usermod -a -G docker ec2-user
    5  sudo chkconfig docker on
    6  sudo yum install -y git
    7  sudo reboot
    8  docker info
    9  sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
   10  sudo chmod +x /usr/local/bin/docker-compose
   11  git clone https://github.com/sipcapture/homer7-docker
   12  cd homer7-docker/heplify-server/hom7-prom-all
   13  docker-compose up -d

However, when it's just sitting there not receiving even the shadow of a sip package from anywhere, the CPU usage is at ~30% constantly. Here us what docker stats shows me:

CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
70bbb41c29c3        homer-webapp        0.00%               11.37MiB / 3.794GiB   0.29%               71.3kB / 92.4kB     0B / 0B             4
9532e13c9276        heplify-server      0.02%               10.12MiB / 3.794GiB   0.26%               688kB / 915kB       0B / 0B             8
b7d204287b06        db                  16.87%              7.145MiB / 3.794GiB   0.18%               666kB / 677kB       0B / 0B             9
692978e8f853        alertmanager        0.05%               9.457MiB / 3.794GiB   0.24%               1.89kB / 0B         0B / 0B             8
660cb7b8852d        nodeexporter        0.00%               11.41MiB / 3.794GiB   0.29%               105kB / 2.25MB      0B / 0B             7
28ee38a8dfa4        caddy               0.00%               5.184MiB / 3.794GiB   0.13%               11.8MB / 12.4MB     0B / 0B             9
25fbdd631948        loki                0.03%               13.64MiB / 3.794GiB   0.35%               3kB / 1.55kB        0B / 0B             10
c23a2a9d351c        prometheus          0.00%               49.17MiB / 3.794GiB   1.27%               2.65MB / 235kB      0B / 0B             10
c4aa60b54081        grafana             17.59%              36.14MiB / 3.794GiB   0.93%               310kB / 11.4MB      0B / 0B             9

This is just after installation, and there is no traffic being directed to the instance at all.

jonastelzio commented 4 years ago

The high idle usage is caused by the 1s interval healthcheck on db and grafana.

Changing this to 10s has mitigated this a lot, but the CPU still spikes every 10s.

adubovikov commented 4 years ago

@jonastelzio sorry, intervall healthcehck of docker ?

adubovikov commented 4 years ago

what is the docker version ?

jonastelzio commented 4 years ago

@adubovikov I changed these two lines in the docker-compose.yml file to be 10s instead of 1s: https://github.com/sipcapture/homer7-docker/blob/master/heplify-server/hom7-prom-all/docker-compose.yml#L84 https://github.com/sipcapture/homer7-docker/blob/master/heplify-server/hom7-prom-all/docker-compose.yml#L189

Docker version:

$ docker version
Client:
 Version:           19.03.6-ce
 API version:       1.40
 Go version:        go1.13.4
 Git commit:        369ce74
 Built:             Fri May 29 04:01:26 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.6-ce
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.4
  Git commit:       369ce74
  Built:            Fri May 29 04:01:57 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.2
  GitCommit:        ff48f57fc83a8c44cf4ad5d672424a98ba37ded6
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683