Freepbx 14 - Mariadb going nuts with CPU usage

I just upgraded from Freepbx 13 to Freepbx 14 using the upgrade script last Friday and I noticed that my CPU will spike at times with MariaDB error logging. However when I check the file it is logging to nothing was written to it. Has anyone else had this problem happen to them yet?

Trying to get some idea of what may be happening as I don’t want it occurring during a reload.

Edit: Made a ticket here: [FREEPBX-16779] Freepbx 14 - UCP Call History causes 100%+ CPU spikes - Sangoma Issue Tracker

look at the process list in the mysql client when the CPU load is high to see what its doing

1 Like

I asked and none of us said we were using CDR so I think a client may have been using the UCP to get a recording. The recordings are stored on a separate disk from the main system, still attached to the same physical hardware.

That’s a relatively light query and can not be optimized. Best bet is for you to prune your cdr

Hum… We would have to discuss doing that. We have people asking for call reports from a year ago.

When this same server/machine was running FreePBX 13 these same queries were being ran and it never used the amount of CPU it is eating up right now, it didn’t even register as anything of importance. So something seems to have changed with the upgrade that ended up slowing down the database and making it use a lot more CPU.

Well if that is the query that is causing your issues there is nothing we can do on the freepbx side as it’s a fairly optimized query. You can look into mysql/mariadb improvements through my.cnf which may help you out.

I noticed similar performance hits while updating 'recordingfiles", adding an index on that field sped up that query over a single days directory from eight minutes to 3 seconds. The table was also covering several year.


Thank you @dicko. I have made the changes to cdr for this cdr version


Damn your fast! Thanks Dicko! I’ll test it out and see how it works.

Ok so I have installed that edge CDR version and it doesn’t make any noticeable difference. Though I did find out how to create the issue on demand. I created a UCP tab with 4 different call histories on it and refreshed then I get this every time:

My CPU spiked at 700 but that’s when I got the screenshot. It stayed around the 500’s until it finished loading after 34 seconds.

That’s really bad performance and I didn’t have it with Freepbx 13, distro version.

You can open an issue on the issue tracker and we can look into it.

Also CPU load on Linux can go well over 100% and still be fine. 100% does not mean the same as it does on windows.

Alright I can create another ticket. I kind of hate creating yet another ticket since I’ve created so many in only a couple days since upgrading to Freepbx 14.

Yup 100% is just 100% of a CPU and we have 12.

Some of the other tickets you created, like ion cube, were not related to FreePBX though. Which tickets are you concerned about?

It’s more that I am just creating tickets non-stop because I keep finding bugs all over the place since the upgrade. Feel like I am spamming you with tickets.

If you want a specific that is concern to me then then the UCP for EPM is a big issue since we cannot edit some people’s buttons due to the way templating works:

Then the new issue I just found about Provisioning Protocols’s Http authentication not working. No ticket yet.

Hi all! We are suffering same problems since the update to FPBX14. It happens 3 times per day aproximatelly and some calls ares stopped. Almost all the RAM is used by mariadb and when this happens.

Any light please?

This thread is 12 months old. Nothing will be helpful here.