The process asyncio_loop occupies the CPU for a long time

bzzjh

Dabbler
Joined
Mar 17, 2022
Messages
15
Hi,I found the process asyncio_loop occupies the CPU for a long time.
I don't know what this process is doing.
pls help


Version:TrueNAS-SCALE-22.02.1

There is a same problem here:
 

Attachments

  • 1.JPG
    1.JPG
    57.4 KB · Views: 354
  • 2.JPG
    2.JPG
    89.8 KB · Views: 339

bzzjh

Dabbler
Joined
Mar 17, 2022
Messages
15
I try to kill the process, once I kill it, These jobs will start automatically:
catalog.sync
catalog.items
catalog.sync_all
 

Attachments

  • 3.JPG
    3.JPG
    52.2 KB · Views: 334

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Please report-a-bug and and then share the bug-id.
If anyone else has the same issue, please comment here or add to the bug-id reports.
 

apl

Dabbler
Joined
Jul 11, 2021
Messages
15
Just piping in to say that I have the same. About 50% asyncio_loop CPU consumption on Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz in my TrueNAS-SCALE-22.02.1 box that only backs up my TrueNAS CORE every night. k3s-server also tends to consume up to 20% even though I have no apps installed.
 

RapidScampi

Cadet
Joined
Oct 15, 2021
Messages
9
This has been a recurring issue for me from alpha right through to full release on the same hardware.

I've got dual E5-2650L v4 CPUs with 14 cores/28 threads each on a fairly light load. asyncio_loop periodically maxes out the CPU and the remedy seems to be a whole system reboot. It did seem to relate to the ctalogue update process which would hang, but that seems to be working.

What does this process actually do? Are there any logs that I can provide to assist?
 

MountainMan

Dabbler
Joined
Dec 10, 2020
Messages
42
What does this process actually do? Are there any logs that I can provide to assist?

Middlewared seems to handle a variety of background services (https://github.com/truenas/middleware) -- from loading/updating app catalogs to providing real-time stats data for the dashboard. At this point there are multiple posts in this forum, on Reddit, and in JIRA regarding middlewared/asyncio_loop consuming both increased cpu and/or memory over time. People point at both app catalog processing (like this post) and Web UI interaction (like this other post) as potential causes.

Personally I see middlewared's async process memory swelling (not not being reclaimed later) just sitting on the UI dashboard page, where a WebSocket is streaming realtime stats data from middlewared. Browsing away from the dashboard I see middleware memory growth slow or stop 90+% of the time (as the data subscription should stop). Although sometimes it doesn't seem to, as if a processes that should have been stopped wasn't, and has entered a tight(er) loop. (Which I see as a step up in background cpu that stays around, along with memory use). Restarting middlewared drops memory and cpu, effectively starting things over without a full reboot.

So I think it's going to take some investigation by IX to get at the root cause(s). But from what I've seen, if I had to *guess*, I'd say there is some issue related to Websocket data data handling/caching which shows up most on pages like the dashboard where there is more data being being sent (via "reporting.realtime"). Total guess though. :)
 

BobOki

Cadet
Joined
Apr 11, 2015
Messages
1
Want to add in I also have this issue. Middlewared goes nuts after awhile and kills interfaces. If I kill the pid for asyncio_loop then all the ram overusage goes away, and the process restarts then python kicks into gear. My process was using around 12gig on a 32gig system, obviously that is quite a bit more than usual.
 

MountainMan

Dabbler
Joined
Dec 10, 2020
Messages
42
One catalog related memory fix is coming in 22.02.2. However, I still think there is a second issue waiting in middlewared related to the dashboard/real-time stats based on what I've seen and other have mentioned.
 

john60

Explorer
Joined
Nov 22, 2021
Messages
85
any logs that I can collect in addition to freenas-debug -A

My system is in that mode right now and appears to get into this state rather frequently.
 

john60

Explorer
Joined
Nov 22, 2021
Messages
85
asyncio_loop using little cpu cycles, then I launch a rsync from the GUI, then asyncio_loop goes to 100% in top on a 6 core system. The rsync task consumes very little CPU.

The login gives you the dreaded "Connecting to TrueNAS ... Make sure the TrueNAS system is powered on and connected to the network."
After quite a while, you may get the login screen.
 
Last edited:
Top