CPU usage increases steadily

I see this Sidekiq CPU usage pattern (the growing part is Sideqik):

Maybe connected with Increased CPU Usage since 3.4.0.beta4-dev ( 58f75ed205 ) upgrade?

How should I investigate?

2 Likes

when did you rebuild your container last? if it was a while ago I recommend you rebuild now.

The first usage drop was after the recommended rebuild.
Last rebuild is one hour old but with same usage pattern.

have you looked at sidekiq, is there a backlog? visit /sidekiq

./launcher enter app
apt-get update && apt-get install -y htop
htop

Is CPU high at the moment?

If it is high, then try to inspect CPU on a process that is running high using:

ps 
top -H -p PID_OF_HIGH_CPU

that is not showing any concerning CPU amount, CPU is hovering on zero now across all processes?

There is no longer running process taking much time.

HTOP shows ever changing CPU utilisation.

Netplan’s stats attribute the raising CPU utilisation to sideqik:

Is there any profiling tooling for sideqik I could enable?

the key is that you need to catch stuff misbahaving, finding background radiation is super hard.

Reading app/jobs/base.rb and MethodProfiler, I would like to learn if the collected metrics could be saved to a report in an accumulated way (as sums of time spent in different jobs) in a production environment.

I understand that detailed logging can be enabled via ENV["DISCOURSE_LOG_SIDEKIQ"], but I expect this to generate a large amount of data in a production environment.

For two-container do you mean the web container or the database/redis container?

the cpu usage is in the web container, but I would rebuild both just in case.

Sorry for the hassle. The staging site was the culprit. Maildev was not running, so all mails failed. I should sleep more.

4 Likes

I wrote here about what I learned:

2 Likes