stefanprodan / swarmprom

Docker Swarm instrumentation with Prometheus, Grafana, cAdvisor, Node Exporter and Alert Manager
MIT License
1.87k stars 733 forks source link

PR proposal: Better CPU limits by default #91

Closed pascalandy closed 5 years ago

pascalandy commented 5 years ago

I had a situation where cadvisor used 100% CPU on my machine (along another process (out of docker)). At this moment I realizes that there were no CPU limit on this stack.

PR Proposal

in our docker-compose.yml, we should include default CPU limits like this:


  cadvisor:
    image: google/cadvisor
    (...)
    deploy:
    (...)
      resources:
        limits:
          cpus: '0.20'
          memory: 128M
        reservations:
          cpus: '0.20'
          memory: 64M

Let me know if it makes sense.

Cheers!

stefanprodan commented 5 years ago

Limiting cadvisor is a good thing I've seen it using lots of CPU before, as for memory I would set it to 512M limit.

pascalandy commented 5 years ago

@stefanprodan the PR is still waiting for you :-p Cheers!

pascalandy commented 5 years ago

Continuing here https://github.com/stefanprodan/swarmprom/pull/92#issuecomment-467459685