My experience with Matomo Archiving is that the interval of the cronjob has to fit the tracking traffic of the website. So, rarely the entire traffic of a website is tracked, because bots and co. are excluded. In addition, further parameters can exclude further βviewersβ. However, additional settings (events, goals) can generate additional tracking traffic. So it depends on the amount of data to be archived.
The interval is OK if the archiving logs are always about the same size and the cronjobs do not overlap. This may be the case when archiving is started for the first time (big size logs, cronjob overlap). In addition, archiving should/must be disabled by browser triggering. Only when the interval is OK, then the CPU load must be observed. If the CPU load for archiving is very high, then Matomo should run on its own server or even only archiving should run on its own server. In very special cases archiving could also be split on several servers.
The retrieval of data for displaying statistics is insofar independent of archiving, if archiving does not have too high a CPU load.
So:
-
First: Adjust cronjob interval.
-
Second: Monitor CPU load.
Example for to the 5. Minute in every hour: 14:05, 15:05, 16:05, β¦
5 * * * * php /usr/www/users/USERNAME/matomo.example.com/console core:archive --url=https://matomo.example.com/
* * * * *
β¬ β¬ β¬ β¬ β¬
β β β β β day in week (0-7) (0 or 7 = Sunday)
β β β βββ month (1-12)
β β βββββ day in month (1-31)
β βββββββ hour (0-23)
βββββββββ minute (0-59)
/ β every 5 minutes: */5 * * * *
, β 0,15,30,45-th minute in every hour: 0,15,30,45 * * * *
- β sometime in the 15-30-th minute in every hour: 15-30 * * * *
@hourly β at every full hour, like: 0 * * * *
@daily β at every midnight, like: 0 0 * * *
@weekly β once in a week, like 0 0 * * 0
@monthly β once in a month, like 0 0 1 * *
@yearly β once in a year, like 0 0 1 1 *
@annually β same as @yearly
@reboot β after every server reboot
With Logs saving:
create directory: /usr/home/USERNAME/matomo-cronlogs/
5 * * * * php /usr/www/users/USERNAME/matomo.example.com/console core:archive --url=https://matomo.example.com/ > /usr/home/USERNAME/matomo-cronlogs/matomo-archive-$(date +"\%Y\%m\%d\%H\%M\%S").log
Quite a bit accumulates there. So check and empty the folder regularly.