Why does CPU% goes beyond 600% while using cadvisor?

0 votes
docker-compose.yml

version: '3.7'
services:
  cadvisor:
    image: google/cadvisor
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:rw
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro
      - /cgroup:/sys/fs/cgroup:ro
    ports:
      - 8080:8080
    privileged: true
    command:
      - --allow_dynamic_housekeeping=true
      - --housekeeping_interval=30s
      - --global_housekeeping_interval=2m
      - --disable_metrics=disk,tcp,udp
      - --docker_only=true
    restart: always
    deploy:
      mode: global

I have disabled most of the flags.I run it with privileged mode yet I see spikes in CPU.How do I make it consume less CPU?

I get the following error too

W0505 06:22:01.988235       1 raw.go:87] Error while processing event ("/sys/fs/cgroup/blkio/system.slice/systemd-tmpfiles-clean.service": 0x40000100 == IN_CREATE|IN_ISDIR): inotify_add_watch /sys/fs/cgroup/blkio/system.slice/systemd-tmpfiles-clean.service: no such file or directory
May 5 in DevOps & Agile by Isabel
• 120 points
57 views
Can you share your use case?

1 answer to this question.

0 votes

Hi@Isabel,

I don't know about container advisor tool, but I used this below code and it works fine in my system.

  • First create one folder.
  • Inside that folder create one file name prometheus.yml file and write down the below code.
scrape_configs:
- job_name: cadvisor
  scrape_interval: 5s
  static_configs:
  - targets:
    - cadvisor:8080
  • Inside that same folder create another file name docker-compose.yml and write down the below code.

version: '3.2'
services:
  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    ports:
    - 9090:9090
    command:
    - --config.file=/etc/prometheus/prometheus.yml
    volumes:
    - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
    depends_on:
    - cadvisor
  cadvisor:
    image: google/cadvisor:latest
    container_name: cadvisor
    ports:
    - 8080:8080
    volumes:
    - /:/rootfs:ro
    - /var/run:/var/run:rw
    - /sys:/sys:ro
    - /var/lib/docker/:/var/lib/docker:ro
    depends_on:
    - redis
  redis:
    image: redis:latest
    container_name: redis
    ports:
    - 6379:6379
  • Now run docker-compose up and browse http://localhost:8080.

answered May 5 by MD
• 24,500 points
My cadvisor is up and running.I only have concern with CPU usage.I'm monitoring around 2k containers.
Set threshold value of RAM and CPU to your container.

Related Questions In DevOps & Agile

0 votes
1 answer

Why does Docker for Windows make you pick either Windows or Linux containers?

Windows machine contains several components and one ...READ MORE

answered Nov 15, 2018 in DevOps & Agile by Sophie may
• 9,940 points
76 views
+1 vote
2 answers

Scp Php files into server using gradle

Tru something like this: plugins { id ...READ MORE

answered Oct 11, 2018 in DevOps & Agile by lina
• 8,200 points
176 views
+2 votes
2 answers

how to set different provisioning profiles for different targets using Xcode Build

For multiple targets, each task has to ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by ajs3033
• 7,280 points

edited Oct 16, 2018 by Kalgi 1,184 views
+5 votes
2 answers

Bootstrap SPAapp using Heroku commands

I've made a few assumptions You want to ...READ MORE

answered Oct 16, 2018 in DevOps & Agile by Kalgi
• 51,850 points
85 views
+6 votes
5 answers

can't remove SSIS variables using remove method on PowerShell

you're missing the additional $environment.Alter() after your ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by ajs3033
• 7,280 points
235 views
+5 votes
3 answers

Error while trying to install postgis extension with greenplum

Try re downloading the package and installing ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,420 points
184 views
+3 votes
1 answer

Unable to find the TargetArguments path While configuring dot cover in VSTS

For your unable to find the TargetArguments ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by ajs3033
• 7,280 points
155 views
0 votes
1 answer

unable to build .Net project using NUGet

you just need the developer pack for ...READ MORE

answered Apr 3, 2018 in DevOps & Agile by ajs3033
• 7,280 points
243 views
0 votes
1 answer

Permission denied when executing module using ansible on host machine

Hi@Shamsher, This error usually occurs when their is ...READ MORE

answered May 28 in DevOps & Agile by MD
• 24,500 points
52 views