dawarich icon indicating copy to clipboard operation
dawarich copied to clipboard

High CPU usage during ?healthcheck?

Open Korenchkin opened this issue 1 year ago • 3 comments

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

Korenchkin avatar Dec 13 '24 20:12 Korenchkin

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)

Korenchkin avatar Dec 13 '24 20:12 Korenchkin

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

Korenchkin avatar Dec 13 '24 21:12 Korenchkin

I may change it in the future, thanks!

Freika avatar Dec 16 '24 13:12 Freika

Thanks @Korenchkin - I can confirm your fix works.

Took the sidekiq container from a constant ~10% CPU usage to zero.

alangrainger avatar Jan 26 '25 14:01 alangrainger

Changing all the health-check's interval from 10s to (the default) 30s also makes a significant difference

burgerga avatar May 12 '25 20:05 burgerga

It's configurable and we have a solution here, so I'll close the issue. Default healthcheck will stay ais it is for now

Freika avatar May 12 '25 21:05 Freika