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…?
Actually, I had a question about that, on the 1hr and 6hr settings when do they actually run…it seems to be (in the 1hr example) every 60 minutes past the time when you created (or last modified) the directory…is that right?
Oh. oops. Yeah I forgot that this doesnt modify the crontab. It runs every 15 minutes but it checks to make sure it hasn’t run since the last run in whatever you set. So everything I said was wrong.
So it’s not running every 15 minutes. You can run it manually and see for yourself: /usr/sbin/fwconsole userman --syncall