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 at 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 at 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20201027/e8df556b/attachment.html>
El Tue, 27 Oct 2020 12:52:47 -0400 Dovid Bender <dovid at telecurve.com> escribió:> 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 > >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
Jon, We are only using FastAgi. On the second system (running Asterisk 16) there are no agi's running (just some bash scripts on call hangup). I did add some hackey code (netstat -nua | grep -v 'udp 0 0' | grep -v udp6 | grep -v ' 0 0.0.0.0' | grep udp) to my bash script to check out the packet queue (with the help of https://serverfault.com/questions/623377/is-there-a-way-to-get-current-txqueue-utilization-on-e-g-eth0-or-tun-device) and it *seems there may be a corelation between packets in the queue and the load on Asterisk [root at a30 ~]# /tmp/x.sh CPU USAGE 393.8 Active calls 317 CPU USAGE 117.6 Active calls 318 CPU USAGE 143.8 Active calls 318 CPU USAGE 305.9 Active calls 318 udp 0 768 0.0.0.0:14510 0.0.0.0:* CPU USAGE 123.5 Active calls 316 CPU USAGE 137.5 Active calls 314 CPU USAGE 329.4 Active calls 314 CPU USAGE 312.5 Active calls 317 CPU USAGE 125.0 Active calls 317 CPU USAGE 137.5 Active calls 316 CPU USAGE 123.5 Active calls 316 CPU USAGE 117.6 Active calls 315 CPU USAGE 117.6 Active calls 314 CPU USAGE 135.3 Active calls 312 CPU USAGE 131.2 Active calls 309 CPU USAGE 131.2 Active calls 308 CPU USAGE 118.8 Active calls 309 CPU USAGE 331.2 Active calls 310 CPU USAGE 111.8 Active calls 309 udp 0 1280 0.0.0.0:15598 0.0.0.0:* CPU USAGE 517.6 Active calls 309 CPU USAGE 137.5 Active calls 308 CPU USAGE 143.8 Active calls 308 CPU USAGE 137.5 Active calls 307 CPU USAGE 311.8 Active calls 308 CPU USAGE 137.5 Active calls 308 CPU USAGE 125.0 Active calls 307 CPU USAGE 156.2 Active calls 307 udp 0 1280 0.0.0.0:19148 0.0.0.0:* CPU USAGE 135.3 Active calls 305 CPU USAGE 305.9 Active calls 307 CPU USAGE 156.2 Active calls 309 CPU USAGE 450.0 Active calls 311 CPU USAGE 137.5 Active calls 310 CPU USAGE 137.5 Active calls 310 CPU USAGE 256.2 Active calls 311 CPU USAGE 150.0 Active calls 308 CPU USAGE 281.2 Active calls 308 CPU USAGE 281.2 Active calls 307 CPU USAGE 137.5 Active calls 304 udp 0 1280 0.0.0.0:11284 0.0.0.0:* CPU USAGE 135.3 Active calls 306 CPU USAGE 150.0 Active calls 309 CPU USAGE 331.2 Active calls 310 CPU USAGE 125.0 Active calls 308 CPU USAGE 117.6 Active calls 307 CPU USAGE 135.3 Active calls 306 udp 0 1280 0.0.0.0:18494 0.0.0.0:* CPU USAGE 137.5 Active calls 307 CPU USAGE 141.2 Active calls 306 CPU USAGE 137.5 Active calls 307 CPU USAGE 562.5 Active calls 308 CPU USAGE 862.5 Active calls 311 CPU USAGE 164.7 Active calls 310 udp 0 768 0.0.0.0:17890 0.0.0.0:* udp 0 1280 0.0.0.0:11504 0.0.0.0:* [root at a30 ~]# On Tue, Oct 27, 2020 at 1:21 PM Jon Bonilla (Manwe) <manwe at aholab.ehu.es> wrote:> El Tue, 27 Oct 2020 12:52:47 -0400 > Dovid Bender <dovid at telecurve.com> escribió: > > > 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 > > > > > > 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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20201027/f61c403a/attachment.html>