Investigating a potential memory leak in one of our FreePBX instance. Overnight we are starting to see daily crashes of the Asterisk service.
We are virtualizing FreePBX on Proxmox and have not seen this issue across our other FreePBX VMs running identical software version/configuration.
VM specs:
CPU: 2 cores
Memory: 8 GB
Storage: 100 GB
Our journalctl shows the following:
Oct 24 11:55:46 dc-prod-pbx01 kernel: out_of_memory+0x1fd/0x4c0
Oct 24 11:55:46 dc-prod-pbx01 kernel: Tasks state (memory values in pages):
Oct 24 11:55:46 dc-prod-pbx01 kernel: Out of memory: Killed process 23390 (asterisk) total-vm:8512928kB, anon-rss:6764080kB, file-rss:0kB, shmem-rss:0kB, UID:999 pgtables:15192kB oom_score_adj:0
We’ve had no issue reports on the Asterisk side for memory leaks like this. The best thing to do would be to isolate the difference between the instance and others. I assume it started after upgrading to 22.11.0?
Yes, started around the update to 22.11.0. Only doing a few config changes a day. When the asterisk process crashes, we have to reboot the VM to get it going again.
We have tried increasing memory on the VM to 12 and even 16 GB, and see the VM crashing with same journalctl logs about being out of memory.
Looking at the full asterisk logs around the same time as the memory crash, I don’t see any correlated events around the same time.
We have had a few (3) servers that had to be rebooted this morning. I am still trying to track something down. All that I did was upgrade PHP and ran fwconsole ma upgradeall.
Users have also complained of BLF issues, call park/transfer calls disappearing, and no audio when dialing out. Everything was working fine until I did patching/updates on Friday.
Does journalctl show anything on your affected servers about memory issues? This is affecting our largest customer with around 400 extensions. Our other installations have less than 100 extensions.
As I was typing this, our server just crashed again
Oct 26 11:38:17 dc-prod-pbx01 kernel: out_of_memory+0x1fd/0x4c0
Oct 26 11:38:19 dc-prod-pbx01 kernel: Tasks state (memory values in pages):
Oct 26 11:38:19 dc-prod-pbx01 kernel: Out of memory: Killed process 1818 (asterisk) total-vm:9942820kB, anon-rss:5298780kB, file-rss:0kB, shmem-r0
Anything? Number of endpoints, number of subscriptions, what you’re doing in FreePBX if anything, applications in use, functionality in use. Difference between a working case and non-working case.
We use Yealink phones, have around 390 PJSIP endpoints across ~8 locations, sites connected via dark fiber back to the datacenter where the server is hosted. We use Endpoint Manager. UCP is running, but rarely used by staff
Only using around 5-10 softphones (MicroSIP). Each location is a school. District admin office and a few departments have ring groups and each building has an auto attendent/IVR that can reach secretary, attendance, counselors, etc.
This server uses a SIP trunk off the provider’s Adtran. Only average 5-10 active calls throughout the day district wide. Mornings and school release are usually busier and we can see 20+ active calls
@packetpusher welcome to the forums. Were there any recent modifications to php.ini ? Any top output you can share to see which process is running away with the memory ?
You might be able to switch to the certified branch of Asterisk 22 using the asterisk-version-switch command. Not exactly a roll-straight-back but more of a roll-diagonally-back.
I can try this this evening. Will that rollback the updates for 22.11.0? My systems seem to crash during the night when there are no users using the system. Before the upgrades, everything was running smooth so something has definitely changed.
Because we are having the server crash during the day, we are going to switch to the certified branch in around 30 minutes after sending out a notice to staff.