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


I created a some new custom reports and for having the historical data in these reports I invalidate the historical reports as described at

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&, 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,


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…