High CPU usage (~20%) in Asterisk 22.2.0 idle state - Stasis/Manager massive event processing

Hi everyone,

I am currently investigating an issue on one of our production instances where the Asterisk process is consistently consuming around 21% CPU, despite having 0 active channels or calls.

While our environment handles high-volume traffic, the CPU usage remains unusually high even during idle periods. Upon checking the core taskprocessors, I noticed massive numbers (in the hundreds of millions) for stasis/pool-control, stasis/pool, and stasis/p:manager:core.

Here are the details of the environment and the command outputs:

Environment:

  • OS: Ubuntu 22.04.5 LTS (Jammy Jellyfish)

  • Asterisk Version: 22.2.0

  • Resources: 12 vCPUs, 12GB RAM

  • Uptime load average: 0.15, 0.11, 0.09 (Asterisk process accounts for most of this).

1. CPU Usage & Active Channels:

[2026-05-29 23:52:33] root@telephony-prod-1 /home/ubuntu# ps aux --sort=-%cpu | grep "/usr/sbin/asterisk"
root      814213 21.1  2.2 6507636 278328 ?      Ssl  May26 945:15 /usr/sbin/asterisk

[2026-05-29 23:52:59] root@telephony-prod-1 /home/ubuntu# asterisk -rx "core show channels verbose"
Channel              Context        Extension        Prio State   Application  Data             CallerID        Duration Accountcode PeerAccount BridgeID
0 active channels
0 active calls
79479 calls processed
asterisk -rx "core show uptime"
System uptime: 3 days, 2 hours, 48 minutes, 44 seconds
Last reload: 12 hours, 6 minutes, 35 seconds
uptime
 00:20:36 up 25 days, 13:03,  2 users,  load average: 0.15, 0.14, 0.10

2. Taskprocessors (Notice the Stasis & Manager stats):

[2026-05-29 23:52:36] root@telephony-prod-1 /home/ubuntu# asterisk  -rx "core show taskprocessors"

Processor                                                               Processed   In Queue  Max Depth  Low water High water
app_voicemail                                                                   0          0          0        450        500
ast_msg_queue                                                                   0          0          0        450        500
CCSS_core                                                                       0          0          0        450        500
dns_system_resolver_tp                                                          0          0          0        450        500
pjsip/default-0000000d                                                        648          0          2        450        500
pjsip/default-0000000e                                                          0          0          0        450        500
pjsip/default-0000000f                                                          0          0          0        450        500
pjsip/default-00000010                                                          0          0          0        450        500
pjsip/default-00000011                                                          0          0          0        450        500
pjsip/default-00000012                                                          0          0          0        450        500
pjsip/default-00000013                                                          0          0          0        450        500
pjsip/default-00000014                                                          0          0          0        450        500
pjsip/distributor-0000002d                                                  12978          0          3        450        500
pjsip/distributor-0000002e                                                  12587          0          3        450        500
pjsip/distributor-0000002f                                                  13212          0          3        450        500
pjsip/distributor-00000030                                                  13249          0          7        450        500
pjsip/distributor-00000031                                                  13490          0          3        450        500
pjsip/distributor-00000032                                                  13022          0          3        450        500
pjsip/distributor-00000033                                                  12637          0          3        450        500
pjsip/distributor-00000034                                                  12957          0          3        450        500
pjsip/distributor-00000035                                                  12614          0          3        450        500
pjsip/distributor-00000036                                                  13070          0          3        450        500
pjsip/distributor-00000037                                                  13145          0         42        450        500
pjsip/distributor-00000038                                                  12610          0          3        450        500
pjsip/distributor-00000039                                                  12589          0          3        450        500
pjsip/distributor-0000003a                                                  13147          0          3        450        500
pjsip/distributor-0000003b                                                  13004          0          3        450        500
pjsip/distributor-0000003c                                                  12737          0          3        450        500
pjsip/distributor-0000003d                                                  13431          0          3        450        500
pjsip/distributor-0000003e                                                  12714          0          6        450        500
pjsip/distributor-0000003f                                                  13007          0          4        450        500
pjsip/distributor-00000040                                                  12839          0          3        450        500
pjsip/distributor-00000041                                                  13232          0          3        450        500
pjsip/distributor-00000042                                                  13069          0          3        450        500
pjsip/distributor-00000043                                                  13209          0          3        450        500
pjsip/distributor-00000044                                                  12645          0          3        450        500
pjsip/distributor-00000045                                                  13058          0          4        450        500
pjsip/distributor-00000046                                                  13456          0          3        450        500
pjsip/distributor-00000047                                                  13121          0         52        450        500
pjsip/distributor-00000048                                                  12833          0          4        450        500
pjsip/distributor-00000049                                                  13426          0          3        450        500
pjsip/distributor-0000004a                                                  12888          0          3        450        500
pjsip/distributor-0000004b                                                  12765          0          3        450        500
pjsip/exten_state                                                               0          0          0        450        500
pjsip/messaging                                                                 0          0          0        450        500
pjsip/mwi-00000062                                                              1          0          1        450        500
pjsip/mwi-00000063                                                              0          0          0        450        500
pjsip/mwi-00000064                                                              0          0          0        450        500
pjsip/mwi-00000065                                                              0          0          0        450        500
pjsip/mwi-00000066                                                              0          0          0        450        500
pjsip/mwi-00000067                                                              0          0          0        450        500
pjsip/mwi-00000068                                                              0          0          0        450        500
pjsip/mwi-00000069                                                              0          0          0        450        500
pjsip/options/4006-0000004e                                                    11          0          1        450        500
pjsip/options/4007-0000004c                                                    11          0          1        450        500
pjsip/options/6000-00000052                                                 30798          0          6        450        500
pjsip/options/agent_monitoreo-0000004f                                         11          0          1        450        500
pjsip/options/manage                                                         8062          0          2       4500       5000
pjsip/options/TRUNK_KAMAILIOR_ORACLE_12-00000058                            13484          0          2        450        500
pjsip/options/TRUNK_ORACLE-COLPENSIONES-1-0000004d                          17964          0          2        450        500
pjsip/options/TRUNK_ORACLE-COLPENSIONES-2-BCK-00000053                       4495          0          1        450        500
pjsip/options/TRUNK_ORACLE-SALIDA-00000051                                  13476          0          2        450        500
pjsip/options/TRUNK_ORACLE_IVR_1_COLP-1-00000056                            17962          0          2        450        500
pjsip/options/TRUNK_ORACLE_IVR_1_COLPR-1-00000054                           13477          0          2        450        500
pjsip/options/TRUNK_ORACLE_IVR_2_COLP-1-00000050                            17966          0          2        450        500
pjsip/options/TRUNK_ORACLE_IVR_2_COLPR-1-00000055                           13484          0          2        450        500
pjsip/options/TRUNK_ORACLE_IVR_2_COLPR-2-00000059                           13475          0          2        450        500
pjsip/options/TRUNK_ORACLE_IVR_2_COLPR-3-00000057                           13480          0          2        450        500
pjsip/pool                                                                 543284          0          5        450        500
pjsip/pool-control                                                        1087074          0          7        450        500
pjsip/refer                                                                     0          0          0        450        500
pjsip/websocket-00000538                                                     1196          0          1        450        500
sorcery/acl-0000006d                                                            0          0          0        450        500
sorcery/aor-0000001a                                                           11          0          1        450        500
sorcery/asterisk-publication-00000061                                           0          0          0        450        500
sorcery/auth-00000015                                                          10          0          1        450        500
sorcery/bucket-00000000                                                         0          0          0        450        500
sorcery/client-0000005f                                                         5          0          1        450        500
sorcery/contact-00000019                                                     3876          0          1       1350       1500
sorcery/domain_alias-0000001b                                                   0          0          0        450        500
sorcery/endpoint-00000016                                                      11          0          1        450        500
sorcery/file-00000001                                                           0          0          0        450        500
sorcery/global-0000001c                                                        15          0          1        450        500
sorcery/identify-0000005a                                                       0          0          0        450        500
sorcery/inbound-publication-0000005d                                            0          0          0        450        500
sorcery/location-00000009                                                       0          0          0        450        500
sorcery/log_mappings-0000000b                                                   0          0          0        450        500
sorcery/nat_hook-00000017                                                       0          0          0        450        500
sorcery/opus-00000008                                                           0          0          0        450        500
sorcery/outbound-publish-00000060                                               0          0          0        450        500
sorcery/phoneprov-0000006f                                                      0          0          0        450        500
sorcery/pool                                                                 3944          0          2        450        500
sorcery/pool-control                                                         8715          0          2        450        500
sorcery/profile-0000000a                                                        0          0          0        450        500
sorcery/registration-0000006b                                                  16          0          1        450        500
sorcery/resource_list-0000005c                                                  0          0          0        450        500
sorcery/subscription_persistence-0000005b                                       0          0          0        450        500
sorcery/system-0000000c                                                         0          0          0        450        500
sorcery/transport-00000018                                                      0          0          0        450        500
stasis/m:ari:application/conexion_millentic_ari-0000007b                  1928533          0         16        450        500
stasis/m:bridge:all-00000071                                                    2          0          1        450        500
stasis/m:bridge:all-0000007a                                                    1          0          1        450        500
stasis/m:cache_pattern:0/endpoint:all-00000007                               5089          0          2        450        500
stasis/m:cdr:aggregator-00000005                                         30476312          0       4945       4500       5000
stasis/m:channel:all-00000072                                                   2          0          1        450        500
stasis/m:channel:all-00000079                                                   1          0          1        450        500
stasis/m:devicestate:all-00000002                                          279247          0          4        450        500
stasis/m:devicestate:all-00000003                                          279247          0          6        450        500
stasis/m:devicestate:all-00000078                                          279041          0          6        450        500
stasis/m:manager:core-00000006                                          110769881          0       1394       2700       3000
stasis/m:mwi:all-00000073                                                       4          0          3        450        500
stasis/m:parking:all-00000070                                                   1          0          1        450        500
stasis/m:presence_state:all-00000004                                            1          0          1        450        500
stasis/m:security:all-0000002c                                                  1          0          1        450        500
stasis/m:security:all-0000006e                                                  1          0          1        450        500
stasis/m:security:all-00000075                                              53311          0          2        450        500
stasis/m:system:all-0000006c                                                    1          0          1        450        500
stasis/m:system:all-00000077                                                    1          0          1        450        500
stasis/p:endpoint:PJSIP/4006-0000001e                                           1          0          1        450        500
stasis/p:endpoint:PJSIP/4007-0000001d                                           1          0          1        450        500
stasis/p:endpoint:PJSIP/6000-00000026                                       20445          0         12        450        500
stasis/p:endpoint:PJSIP/agent_monitoreo-00000027                                1          0          1        450        500
stasis/p:endpoint:PJSIP/default_endpoint-00000025                               1          0          1        450        500
stasis/p:endpoint:PJSIP/TRUNK_KAMAILIOR_ORACLE_12-00000024                      1          0          1        450        500
stasis/p:endpoint:PJSIP/TRUNK_ORACLE-COLPENSIONES-1-0000001f             28630560          0        255        450        500
stasis/p:endpoint:PJSIP/TRUNK_ORACLE-COLPENSIONES-1-BCK-00000020                1          0          1        450        500
stasis/p:endpoint:PJSIP/TRUNK_ORACLE-SALIDA-00000021                            1          0          1        450        500
stasis/p:endpoint:PJSIP/TRUNK_ORACLE_IVR_1_COLP-1-00000022                  15132          0          8        450        500
stasis/p:endpoint:PJSIP/TRUNK_ORACLE_IVR_1_COLPR-1-00000028                     1          0          1        450        500
stasis/p:endpoint:PJSIP/TRUNK_ORACLE_IVR_2_COLP-1-00000023                      1          0          1        450        500
stasis/p:endpoint:PJSIP/TRUNK_ORACLE_IVR_2_COLPR-1-00000029                     1          0          1        450        500
stasis/p:endpoint:PJSIP/TRUNK_ORACLE_IVR_2_COLPR-2-0000002a                     1          0          1        450        500
stasis/p:endpoint:PJSIP/TRUNK_ORACLE_IVR_2_COLPR-3-0000002b                     1          0          1        450        500
stasis/p:manager:core-000001c0                                           88043320          0        535        450        500
stasis/p:manager:core-000001c2                                           87897583          0        500        450        500
stasis/p:manager:core-0000034a                                           60630038          0        325        450        500
stasis/p:manager:core-0000034d                                           60465195          0        325        450        500
stasis/p:manager:core-00000355                                           59382210          0        325        450        500
stasis/p:manager:core-000004ea                                           33602596          0        234        450        500
stasis/p:manager:core-000004eb                                           33602561          0        234        450        500
stasis/p:manager:core-00000634                                           15348085          0        165        450        500
stasis/p:manager:core-00000638                                           15337385          0        167        450        500
stasis/p:manager:core-00000639                                           15337348          0        167        450        500
stasis/p:manager:core-000006ea                                           10905569          0         94        450        500
stasis/p:manager:core-000007cc                                             352237          0         46        450        500
stasis/pool                                                             429755325          0         14        450        500
stasis/pool-control                                                     859460776          0       1457        450        500

147 taskprocessors


3. AMI Connected Users:

[2026-05-29 23:53:04] root@telephony-prod-1 /home/ubuntu# asterisk -rx "manager show connected"
  Username         IP Address                      Start       Elapsed     FileDes   HttpCnt   ReadPerms   WritePerms
  user_rtp         127.0.0.1                       1779849123  267667      34        0         0000000543  0000000000
  amiTelephonyProd 192.168.X.X                     1779896094  220696      246       0         0000004079  0000004851
2 users connected.

4. AMI Configuration (manager.conf):

[user_rtp]
secret =  
read = system,call,log,verbose,command,reporting
write = none

eventfilter = Event: RTCPReceived
eventfilter = Event: RTCPSent
eventfilter = Event: VarSet

[amiTelephonyProd]
secret =  
permit=10.10.X.X/255.255.255.0
permit=192.168.X.X/255.255.255.255
writetimeout=10000
read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan,login
write = system,call,agent,user,config,command,reporting,originate
;eventfilter = Event: Agent*
eventfilter = Event: Hangup
;eventfilter = Event: Hold
;eventfilter = Event: Bridge*
;eventfilter = Event: Link
;eventfilter = Event: Unlink
;eventfilter = Event: Join
;eventfilter = Event: Leave
;eventfilter = Event: Queue*
eventfilter = Event: UserEven*
;eventfilter = Event: Unhold

My thoughts & Questions: It seems that the high CPU usage is caused by Asterisk processing millions of internal events through Stasis to feed the AMI connections, even when no calls are active.

  1. Given the configuration, could read = verbose or read = log in manager.conf be flooding Stasis with unnecessary events in the background?

  2. Are my eventfilter settings properly configured to drop unwanted events at the source, or is Asterisk still processing everything internally before discarding it at the socket level?

  3. Any specific recommendations to optimize AMI or PJSIP configurations (like adjusting qualify_freq) to prevent this CPU burn while idle?

Thanks in advance!

Start by upgrading to a recent version of Asterisk, because stasis/pool-control and stasis/pool doesn’t exist anymore in recent versions.