High CPU usage during ?healthcheck?
hello, every 10s i see moderately high cpu usage about 50% for about 2s (using top, "d.1") i guess this one: root 2618 0.0 0.0 1628 768 ? Ss 20:45 0:00 /bin/sh -c bundle exec sidekiqmon processes | grep ${HOSTNAME} root 2625 0.0 0.3 459788 13232 ? Rl 20:45 0:00 /usr/local/bin/ruby /usr/local/bundle/bin/bundle exec sidekiqmon processes
spawns for every healthcheck
while not critical,some lower powered systems could be overwhelmed? thanks, pb
oh great,i'm the first one to be bothered,your way is the most official i found,so i need to suck it up,this world is not built for optimization :) ( https://stackoverflow.com/questions/50053577/how-to-check-health-of-docker-image-running-sidekiq ) so,i would call this low priority...unless it is only on my side or nobody noticed yet? (2 cores,not dedicated, lxc, i5-7600k)
ok,for now for me this in docker compose:
healthcheck:
# test: [ "CMD-SHELL", "bundle exec sidekiqmon processes | grep $${HOSTNAME}" ]
test: [ "CMD-SHELL", "ps axu|grep -i [s]idekiq\ 7" ]
(sorry,code block making fun of me) this replaces launching something large every 10s with something much smaller :) hope it does detect everything,but since i easily miss full disk,i think i'll be okay if it does not detect frozen process
I may change it in the future, thanks!
Thanks @Korenchkin - I can confirm your fix works.
Took the sidekiq container from a constant ~10% CPU usage to zero.
Changing all the health-check's interval from 10s to (the default) 30s also makes a significant difference
It's configurable and we have a solution here, so I'll close the issue. Default healthcheck will stay ais it is for now