ok, I know that this seems to be a bad topic right now, but I just dealt with an issue related to this and thought I would share my experience.
I am sure there are many reasons why your cpu might spike, this one I happen to catch by accident and it has to do with ldap synchronization.
I happen to notice while running htop that the ldap sync process was running long (1 to 2 minutes) and pegging the cpu the whole time. That made me think about what it was doing. The default when you set up an ldap directory in FreePBX seems to be sync every hour:
If you ldap directory is small, I am sure this would have little impact, but we have a medium size directory and I believe scanning through it was just taking a lot.
To fix this, I change the synchronization to daily so we would not be impacted often.
I want to make something clear…I do NOT think this is a bug or fault in FreePBX, the size of your ldap directory, the starting point you picked in the setup and the power behind your domain controller (or ldap server) all contribute to how long it takes to scan. I am just documenting this in case anyone else needs this help.
I guess I do have one suggestion for Sangoma, maybe you should rethink the 1hr default setting…?