Hi All,
I have posted about this in the past but every time I hit a road block and gave up. I want to try to really focus this time on getting the issue solved. I have a system that is used to play recordings on the phone. All calls come from the a SIP providre with PJSIP. Every call that comes in launches a php agi for under a half second. The system then uses ODBC to get a list of files to play. Once the user selects a file to play Asterisk uses ControlPlayBack to play the file from CloudFlare R2. Once we go over 50-75 calls the load on the system will randomly go up for a few moments and then go down. I have written a lot of scripts to try to get stats on the system. The problem is the load jumps for such a small period that by the time I see anything the load is on the way back down and it’s impossible to see what is causing it. For instance right now here is what my top looks like.
top - 17:53:08 up 407 days, 34 min, 1 user, load average: 0.83, 2.76, 4.58
Tasks: 718 total, 1 running, 717 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 0.4 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.1 hi, 0.2 si, 0.0 st
MiB Mem : 7681.6 total, 322.0 free, 6318.9 used, 1040.7 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 581.3 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1380869 user 20 0 19.8g 4.9g 9588 S 29.4 65.6 23227:40 asterisk
3447012 root 20 0 264768 5260 3780 R 11.8 0.1 0:00.03 top
1 root 20 0 241192 8216 3076 S 0.0 0.1 100:30.63 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:37.57 kthreadd
You can see a short while ago the load went up but now it’s stable. Whenever the load goes up for that short period, it takes time for it to come down. During that entire time period the quality goes bad and it seems packets are dropped.
I also tried doing
watch -n 0.2 'top -b -n 1 | head -n 10'
and watching in realtime if I see any process maxing out the CPU for a moment (I know load is not just CPU but memory and disk too). I am not able to see any correlation with the processes in top and what would cause the load to randomly jump. I don’t think it’s the AGI’s as for instance now I just did channel hangup all which killed 90 calls all that call an agi on hangup and it didn’t jump. I am running 22.10.0 on a VPS whose host I control. I also noticed that it seemed like there is some sort of memory leak as asterisk was using 65% of the memory (the VM has 8GB of ram).
Any pointers what could be causing the spikes and were I should start looking?