FreePBX | Register | Issues | Wiki | Portal | Support

CPU utiliziation spikes......gulp


(Tony Guadagno) #1

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:
image

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…?


(Andrew Nagy) #2

It’s because freepbx doesn’t do incremental sync. It should. So every time it runs it takes a long time and has to reprocess all users and groups.


(Tony Guadagno) #3

Hmm, is that an opportunity for improvement? should I put in a feature request?


(Andrew Nagy) #4

There’s might already be one. I’m not certain. Definitely should be improved.


(Andrew Nagy) #5

Setting to daily also makes it happen at 12am. Which is probably low activity for most pbxes


(Tony Guadagno) #6

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?


(Tony Guadagno) #7

fyi, for anyone who want to vote on this
https://issues.freepbx.org/browse/FREEPBX-19974


(Andrew Nagy) #8

It’ll show up in crontab. Or if you upgraded under

fwconsole job --list

(Tony Guadagno) #9

I get this:

[root@uepbx1 ~]# fwconsole job --list

Command “job” is not defined.

also, my /etc/crontab is empty


(Andrew Nagy) #10

Crontab for the asterisk user

As for job. You have to upgrade framework to edge if you wanted that.


(Tony Guadagno) #11

so, i see in /var/spool/cron/asterisk this:

*/15 * * * * /usr/sbin/fwconsole userman --syncall -q

I have 2 AD directory’s configured and I have them both set to daily sync…what is this line doing…it seems to be syncing every 15 minutes?


(Andrew Nagy) #12

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


(Tony Guadagno) #13

so, i think i understand, it check every 15 minutes to see if it needs to run or not based on the sync setting on the directory?


(Andrew Nagy) #14

Exactly. Sorry for the confusion


(system) closed #15

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.