Score:0

What (low priority thread) is causing 100% CPU usage in my node alpine container?

li flag

I have a node alpine docker container (hosted on Azure) which periodically reaches 100% CPU usage. However, running the top or htop command shows no threads having high CPU usage.

How do I find out what the cause is? It seams like the node process isn't causing the high CPU usage. I also ran the node profiler and the cpu profile from the times when CPU is 100% has no obvious change to a regular profile.

htop screen shows that CPU is at 100% (mostly blue, meaning low priority threads). But the threadlist below only shows 17% usage for node.

The high CPU usage is quite periodic: CPU usage over time. And it started a couple days ago after an deployment, but there were no significant code changes (and reverting did not fix the issue).

Edit:

vmstat (first during normal cpu usage, 2nd during 100% CPU)

ae7d7f5ef9c8:~# vmstat 1 5
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 7  0 457816 296204 275828 1383336    4    6   167   571    0   17 33 13 54  1  0
 0  0 457816 296576 275860 1383388    0    0     0   256    0 4297 30 14 56  0  0
 0  0 457816 296576 275908 1383340    0    0     0   296    0 4301 23  8 69  0  0
 0  0 457816 296576 275932 1383348    0    0     0   208    0 2985 22  8 70  0  0
 0  0 457816 296576 275940 1383348    0    0     0    80    0 2444 21  4 75  0  0

ae7d7f5ef9c8:~# vmstat 1 5
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 3  0 459432 285672 259408 1331844    4    6   167   571    0   23 33 13 54  1  0
 1  0 459432 247584 259420 1331860    0    0     0   124    0 4078 76 24  0  0  0
 1  0 459432 122716 259468 1331988    0    0     0   300    0 5521 64 36  0  0  0
 2  0 459432 282488 259504 1332020    0    0     0   212    0 5351 76 24  0  0  0
 5  0 459432 228736 259596 1332024    0    0     0   340    0 3257 76 24  0  0  0
Romeo Ninov avatar
in flag
what is the result of `vmstat 1 5`?
Zareh Kasparian avatar
us flag
system resource bottlenecks such as disk I/O, network I/O may cause CPU peak
zapdev avatar
li flag
The application has no disk I/O operation except logging and htop doesn't show significant usage in regards to disk IO.
zapdev avatar
li flag
Regarding network I/O: The issue is also during night with <1000 request/minute. (During day 10k requests/minute)
Score:0
li flag

Update: The issue seem to be with Azure Webapp platforms. After creating a new Webapp an deploying there, the issue is gone.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.