Summary:ASTERISK-15845: CPU usage increases if WaitEvent not called
Reporter:Tim King (timking)Labels:
Date Opened:2010-03-20 08:33:34Date Closed:2015-03-27 15:24:48
Versions:Frequency of
Description:If someone logs in via the mxml interface with reporting rights then all  events are buffered until they log out (or timeout) or call WaitEvent. If the timeout is long and/or they issue other commands regularly such as Status - but crucially not WaitEvent - then Asterisk starts to consume RAM and significant CPU. The RAM usage is obvious but I don't see why having 10,000 events waiting in the queue should cause increased CPU, although giving the command
manager show eventq
in this case did cause asterisk to drop all current calls. Timeouts while list is locked I assume.


I have added something to the documentation in voip-info.org so users are warned about this gotcha.
Comments:By: Leif Madsen (lmadsen) 2010-03-22 14:23:34

Acknowledging issue. Typically adding this type of information to voip-info.org is what increases the noise ratio over top of the signal ratio though. If someone has an issue it is generally best if they just search the bug tracker for related issues.

By: Matt Jordan (mjordan) 2015-03-27 15:24:48.255-0500

I took the latest from Asterisk 11 and did the following:

* Pointed a browser at {{http://localhost:8088/manager}}, and logged in
* Kept the connection up by pinging the server every now and again (running "List commands")
* Constantly originated a Local channel that dialled a SIP channel to build events
* Verified that there were a pile of events in the eventq
* Watched top

At no point did the CPU climb noticeably.

As Leif pointed out, even if this was an issue, not calling WaitEvent periodically is a violation of the contract that the HTTP Manager has with its clients.