High asterisk CPU usage

can CPU usage be related to a number of Virtual extensions?


why Hints are created for Virtual extension at all

Because virtual extension have a custom device state so they can use Do Not Disturb or use BLF to see that DND or Call Forwarding are active on the extension.

so can high CPU usage be related to Asterisk is constantly trying to check Virtual extension statuses?
(if I have 450 Virtual extensions)

can i somehow disable creating Hints for Virtual extension?

It’s event based, it’s not constantly checking or polling. The provided screenshots show nothing out of the ordinary.

  1. What does “High asterisk CPU usage” mean?
  2. What is actually going on in Asterisk?
  3. Does restarting result in continued high usage?
  4. Where is Asterisk running? (For example - a shared VM environment can result in CPU theft which impacts things)
1 Like

1-it means it is on top of CPU process even without calls in place

2- it is running up to 20 calls
3- restart makes no diff
4 - yes it is a shared VM (XCP-NG )

my concern is that it takes a lot of time to Reload (prev it was about 10 sec now >40)

time fwconsole reload

Reload Started
Reload Complete

real	0m41.242s
user	0m18.582s
sys	0m3.828s
  • when i click on listen to call rec from CDR <2 min duration
    it takes 13 sec before playback starts (prev it was almost instantly )

as you can see on first picture load average is ok
disk speed 265 MB/s, good enough NVME SSD


I/O is not an issue

“fwconsole reload” generally spends most of its time in FreePBX land, if you do “time asterisk -rx ‘reload’” how long does it take? The CDR thing also does not involve Asterisk.

Asterisk shows as 22%, so I would not expect it to be impacting FreePBX.

time asterisk -rx ‘reload
No such command ‘‘reload’ (type ‘core show help ‘reload’ for other possible commands)

real 0m0.024s
user 0m0.009s
sys 0m0.015s

maybe you mean

time asterisk -rx "core reload"

real	0m4.139s
user	0m0.011s
sys	0m0.009s

So from an Asterisk perspective it took a little over 4 seconds. That likely means the rest of the time for “fwconsole reload” would be it regenerating configuration files based on details from the underlying MySQL database, so I’d check the MySQL database and still double check the underlying disk.

database asterisk right ?
there are settings correct ?
image

That is outside of my knowledge, someone else may jump in. I was just looking at it from an Asterisk perspective, which I don’t think is the core issue.

I should add that the investigation I was referring to was not the contents - but the MySQL server itself, such as looking to see if it is reporting slow queries. For disk there is the ioping utility which can provide some insight into disk I/O latency that can indicate issues.

thanks for it
regards