Expert To Work On Load Issue

Home » Asterisk Users » Expert To Work On Load Issue
Asterisk Users 4 Comments

Hi,

Sorry in advance that I am emailing the users list and not the biz list I
think I will find my target audience here. We are looking to hire a consultant to help us figure out an issue. We are having what seems are
“random load” issues with bare metal boxes that are dedicated to Asterisk and a few Perl AGI’s. We went after all the usual suspects (CPU IDLE, memory usage etc.). I wrote the simple bash script below to show me total calls and CPU usage of Asterisk
#! /bin/bash

for i in {1..50}
do
CALLS=$(asterisk -rx’core show calls’ | head -n 1 | awk ‘{print
$1}’)
CPU=$(top -b -n 1 | grep $(pidof asterisk) | awk ‘{print $9}’)
echo “CPU USAGE $CPU Active calls $CALLS”
done

And this was the output:
[root@a30 ~]# /tmp/x.sh CPU USAGE 231.2 Active calls 391
CPU USAGE 188.2 Active calls 392
CPU USAGE 658.8 Active calls 392
CPU USAGE 211.8 Active calls 389
CPU USAGE 470.6 Active calls 391
CPU USAGE 841.2 Active calls 390
CPU USAGE 694.1 Active calls 388
CPU USAGE 223.5 Active calls 387
CPU USAGE 237.5 Active calls 394
CPU USAGE 517.6 Active calls 397
CPU USAGE 643.8 Active calls 397
CPU USAGE 211.8 Active calls 397
CPU USAGE 470.6 Active calls 397
CPU USAGE 217.6 Active calls 403
CPU USAGE 452.9 Active calls 406
CPU USAGE 200.0 Active calls 403
CPU USAGE 462.5 Active calls 403
CPU USAGE 206.2 Active calls 402
CPU USAGE 452.9 Active calls 404
CPU USAGE 211.8 Active calls 405
CPU USAGE 206.2 Active calls 405
CPU USAGE 452.9 Active calls 406
CPU USAGE 458.8 Active calls 406
CPU USAGE 200.0 Active calls 406
CPU USAGE 458.8 Active calls 405
CPU USAGE 188.2 Active calls 404
CPU USAGE 470.6 Active calls 405
CPU USAGE 200.0 Active calls 403
CPU USAGE 194.1 Active calls 403
CPU USAGE 506.2 Active calls 402
CPU USAGE 188.2 Active calls 400
CPU USAGE 468.7 Active calls 399
CPU USAGE 212.5 Active calls 396
CPU USAGE 188.2 Active calls 398
CPU USAGE 337.5 Active calls 397
CPU USAGE 805.9 Active calls 399
CPU USAGE 212.5 Active calls 398
CPU USAGE 700.0 Active calls 400
CPU USAGE 200.0 Active calls 398
CPU USAGE 211.8 Active calls 401
CPU USAGE 231.2 Active calls 402
CPU USAGE 206.2 Active calls 402
CPU USAGE 217.6 Active calls 403
CPU USAGE 1081 Active calls 403
CPU USAGE 258.8 Active calls 404
CPU USAGE 537.5 Active calls 407
CPU USAGE 1106 Active calls 410
CPU USAGE 617.6 Active calls 410
CPU USAGE 494.1 Active calls 410
CPU USAGE 1200 Active calls 408
[root@a30 ~]#

The above is with Asterisk 11.25

I am *assuming* that the load issue is being caused by the spikes generated by Asterisk. Below is the output of a different Asterisk system not running any AGI’s. It is running Asterisk 16.

CPU USAGE 61.1 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 633.3 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 72.2 Active calls 81
CPU USAGE 61.1 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 66.7 Active calls 82
CPU USAGE 66.7 Active calls 82
CPU USAGE 70.6 Active calls 82
CPU USAGE 70.6 Active calls 82
CPU USAGE 61.1 Active calls 82
CPU USAGE 70.6 Active calls 82
CPU USAGE 66.7 Active calls 82
CPU USAGE 70.6 Active calls 82
CPU USAGE 70.6 Active calls 82
CPU USAGE 66.7 Active calls 82
CPU USAGE 70.6 Active calls 82
CPU USAGE 64.7 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 64.7 Active calls 81
CPU USAGE 64.7 Active calls 81
CPU USAGE 61.1 Active calls 81
CPU USAGE 64.7 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 64.7 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 1029 Active calls 81
CPU USAGE 66.7 Active calls 80
CPU USAGE 70.6 Active calls 80
CPU USAGE 66.7 Active calls 80
CPU USAGE 70.6 Active calls 80
CPU USAGE 66.7 Active calls 80
CPU USAGE 64.7 Active calls 80
CPU USAGE 64.7 Active calls 80
CPU USAGE 66.7 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 64.7 Active calls 81
CPU USAGE 61.1 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 61.1 Active calls 81
CPU USAGE 61.1 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 66.7 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 64.7 Active calls 81
CPU USAGE 61.1 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 70.6 Active calls 81
CPU USAGE 61.1 Active calls 81
CPU USAGE 947.1 Active calls 81
CPU USAGE 64.7 Active calls 81
CPU USAGE 61.1 Active calls 81

TIA.

Dovid

4 thoughts on - Expert To Work On Load Issue

  • El Tue, 27 Oct 2020 12:52:47 -0400
    Dovid Bender escribió:

    Did you try FastAGI? Asterisk doesn’t handle spawning many processes very well. It’s a bottleneck.


    PekePBX, the multitenant PBX solution https://pekepbx.com

  • Hi Dovid,

    unfortunately I do not. We have seen similar issues when using Perl AGI
    Scripts when using Asterisk16/17. But since we moved everything to Java FastAGI we haven’t seen any load issues anymore. Are you doing anything from fastagi that takes a lot of time? Something like a Playback? We Don’t. We tried to do everything that takes some time in the Dialplan.

    Maybe you could try to kill the Asterisk with “kill -9” to see in the backtrace what the Asterisk is doing when it has such a high load.

    In the Backtrace you should be able to have a look at all processes and what they are doing. I guess i do not have to say “DON’T do it on the production system” 🙂

    BR
    Jöran