High CPU on apply changesg

Fresh install from scratch Freepbx Distro v16 with default settings & Asterisk v16. This is a remote KVM VPS server in a datacenter on SSD drives. Single core CPU shows 2.4Ghz available and 4MB cache, which should be plenty.

I have tried other providers/datacenters and it’s a similar story, so this does not have anything to do with the datacenter or the physical server I am on.

When I do an apply changes on Freepbx it can take up to 1 minute to complete (varies widely each time) and the PHP process CPU utilization varies anywhere from 20-75%, which seems high just to apply changes.

Is there any way to optimize CPU usage on apply changes to speed things up and reduce CPU utilization? Any chance the developers can optimized this more?

I tried disabling all the commercial modules, which are installed and enabled by default on the distro, but it didn’t seem to help much if at all.

More relevant info would be number of endpoints and memory available.

1GB Memory, almost fully utilized but most is buff/cache which is just how linux always tries to use all available memory. 1GB Swap, almost 0% utilized and doesn’t vary when doing an apply changes, in other words no swapping. No extensions no trunks no nothing. Just a default install from scratch. No caching installed or anything like that, unless a default install has that installed already.

I am resizing to 2GB to see if it makes much difference.

compare clicking the bar with fwconsole reload from a shell.

Good idea. Reload is definitely faster from console, always has been. So AJAX is part of the reason for the delays. However CPU load is still a problem on console and UI.

I upgraded to 2GB Memory. Although that seems to make the apply changes complete faster from the UI (but unchanged for console), it also increased PHP load on UI and console. Now it’s hitting up to 60-80% or more almost every time.

Even a fwconsole chown is kind of hard on the CPU. Also hitting 80% sometimes.