Archive cronjob for Matomo... is this running out of the box, or should Matomo still be setup to archive when accessed from the browser?
-
I noticed out of the box the Matomo configuration shows that it's set to "Archive reports when viewed from the browser" (Yes), but it mentions for medium-high traffic sites to disable that and rely on the cron job. I looked to see if there was a cronjob or if I could enable one, and I see the cron task for archiving in the Cron tab in Console view, so I assume this means this cron is executed automatically on a regular basis, is that correct? If so, we should perhaps try to make the image to disable web archiving "when viewed from the browser" by default, so that it's setup more optimally to take advantage of the archive script. I believe that setup is "best practice" for Matomo.
My confusion here though is... is this cron actually scheduled? And if so, how often does it run? When running "crontab" or something in console, I get no output, so I'm just not certain how a user can tell where cron jobs are scheduled and how often they run, etc. I see the script exists, but can't tell if it's being run on a regular basis. Any insight would be appreciated.
Thank you in advance.
-
Ah, I think I answered one of my own questions after just a few more minutes of trying to figure it out, lol, go figure.
So it seems these are setup in the CloudronManifest file, correct? According to the Git for Cloudron's Matomo project, it's running every 15 minutes. https://git.cloudron.io/cloudron/matomo-app/-/blob/master/CloudronManifest.json
So with that known that it's at least running on its own, does it make sense then to have the setting for Matomo out of the box be set to "No" for "Archive reports when viewed from the browser?" if it's possible to do with a config file? Just seems like one of those things where we're duplicating work - Matomo is now archiving reports two times, once every 15 minutes per the cron, and also whenever it's accessed via the browser. This goes against Matomo's recommendations.
Screenshot below. I set mine temporarily to "No" after my own digging into the package, but it's "Yes" by default. It recommends setting to "No" when a cron task for this is running though.
-
Correct. I can say this seems to make using the mobile app much quicker too when it’s disabled to archive on site load, likely since it isn’t needing to wait for the script to run when loading the app. So this would be a performance boost too once it’s corrected.
-
@girish A fresh install already has it set to "No"? Interesting, I don't recall ever setting mine to "Yes", but I guess I did. Thank you for confirming, seems it's okay then if it's set to "No" by default and the cronjob is doing it automatically.