What is the optimal setting for time_before_today_archive_considered_outdated?
The setting, time_before_today_archive_considered_outdated
determines how often Matomo refreshes today’s reports. Setting this value appropriately helps balance how often reports are updated without overloading your server. This is particularly important for maintaining performance at scale.
- For Matomo Cloud, the default value is 21600 seconds (6 hours).
- For Matomo On-Premise, it is 900 seconds (15 minutes).
MATOMO ON-PREMISE ONLY
If you’re self-hosting Matomo, the default is defined in your config/config.ini.php file as:
[General]
time_before_today_archive_considered_outdated = 900
This setting is functionally equivalent to the Archive reports at most every X seconds option found in the Matomo interface: Matomo settings > System > General settings.
What is the optimal setting for Matomo On-Premise?
The setting (time_before_today_archive_considered_outdated
) should match the most frequent archiving job set by your cron job (in Windows: scheduled task).
How often to run the archiver
Archiving is another term for running console core:archive
.
The setting, time_before_today_archive_considered_outdated
does not initiate the archiver; you still need to automatically call your archiving function using cron job in Linux or scheduled task in Windows. See more information in our auto-archiving guide.
How often should archiving be?
- Low traffic (< 10,000 visits/day): Frequent archiving is usually fine, as data volumes are low and pose little strain on the server. You might try running it every 30 minutes.
- Medium traffic (10,000 – 100,000 visits/day): Moderate archive intervals help keep reports timely without overloading system resources. Running every 1 or 2 hours is common.
- High traffic (> 100,000 visits/day): Reduce archive frequency to avoid excessive background processing that could degrade performance. Running every 6 to 24 hours is recommended.
- A common high traffic strategy is to set multiple cron jobs. For example, run one less-frequent core:archive cron job for your highest traffic site (once per day is the longest interval we have seen for a website that gets >10,000,000 hits per month) and a more-frequent core:archive cron job for the rest of your websites (perhaps once per hour). In a case like this, you would set
time_before_today_archive_considered_outdated = 3600
.
Server performance
The capacity of your server determines how often it can handle archiving without delays or timeouts:
- Dedicated servers with SSD storage, high RAM, and multi-core CPUs can process archive updates more frequently without issue.
- Shared hosting or low-resource environments may struggle with frequent updates. Use longer intervals to avoid timeouts or excessive load during peak traffic periods.
How to test and adjust the setting
You may need to fine-tune the archiver frequency depending on your actual usage patterns and system behaviour.
Monitor server performance
Check how your server responds to different archiving intervals. Monitor CPU, memory usage, and database activity.
- If you experience high load, slow dashboards, or delays in data processing, increase the interval for executing your archiver process.
- If your reports appear outdated or data lags behind, reduce the interval to archive more frequently.