Error "Too many connections" in log viewer / Server CPU on 100 % for days

Hello,

I created a some new custom reports and for having the historical data in these reports I invalidate the historical reports as described at https://matomo.org/faq/custom-reports/faq_25265/-

I did this about two days ago. Since that the cpu load is on 100 %.

I also recognized that I have often db connection errors in the log viewer, like this:

Exception: /opt/bitnami/apps/matomo/htdocs/core/Tracker.php(241): Connect failed: Too many connections [Query: ?action_name=%2Fjobs&idsite=6&rec=1&r=495585&h=17&m=44&s=9&url=https%3A%2F%2Fwww.xxxxx.de%2Fjobs&_id=5777ce528888312e&_idn=0&send_image=0&_refts=1677256889&_ref=https%3A%2F%2Fwww.google.de&cookie=1&res=414x896&_cvar=%7B%221%22%3A%5B%22isPwa%22%2C%22false%22%5D%7D&pv_id=i2ExMg&uadata=%7B%7D, CLI mode: 0]

I seems that the system is still running to re-create the data for segments, custom reports etc. There are a lot of archived-stuff-entries in the log.

Is it normal that this takes so much time?

Do you have any tipps how to improve and solve this?

Thanks for some help!

Best regards,

Timo

The load is still on 100 %.

I deleted some segments and custom reports to reduce the data that has to be prepared/processed.

For now I don’t have the “too many connections” error anymore.

But when I look at a custom report for the past (for example 10/2022) there is no data.

In the log viewer there are continually entries like this:

initiating archiving via core:archive for [idSite = 6, period = day 2022-12-07,2022-12-07, segment = campaignSource==google;campaignMedium==cpc, plugin = CustomReports, report = 37]

How can I see the status of this, mean when this all will be finished?

Do I have to wait until all entries in matomo_archive_invalidations are handled? Currently there are 135.284 entries in the table…

Hi @iparker
For the “Too many connection” error while tracking, I would suggest, maybe, to use the Queued Tracking. It could reduce the number of connections at the same time:

I think this depend on the number of hits per day, of segments, of reports… and number of periods to proceed :wink:
In the log, you may get the average delay used to generate a report…