When does logs update automatically?


(nci) #1

Hello,

How often do the logs get updated? I’ve just installed and added the tracking to my sites, and it’s not updating very fast. I know I can delete the archive tables but that’s a pain to get the now stats for today.

Is there a setting where today’s stats can be realtime and all other stats are archived as normal?


(c3chong) #2

You could add the following line to your config.ini file:

[Debug]
always_archive_data_day = 1

That would perform archive operations at every request. I wouldn’t recommend it though, as it would probably be incredibly taxing on your server, as any archive request would trigger the archive process.

By default an archive for the current day is considered outdated after 10 seconds:

[General]
; Time in seconds after which an archive will be computed again. 
; This setting is used only for today's statistics.
; Defaults to 10 seconds so that by default, Piwik provides real time reporting.
time_before_today_archive_considered_outdated = 10

Assuming you haven’t changed that config option, the administrators suggest that there’s an issue with your server clock not being set to the correct timezone. You can check your archive table and make sure that the most recent archive isn’t several hours in the future - if it is, that’s likely the cause.

It could also be that you’re looking at a period other than “Day”. The archives for “Day” become stale within 10 seconds (by default), however archives for longer periods are considered fresh if they were calculated on the current day. What this means is that you’ll see real time updates if you’re examining on a per-day level, but not if you’re looking at a week/month/year.

If you want to force week/month/year archives to happen every time, you can do it via:

 
[Debug]
always_archive_data_period = 0;

But again, it’ll be a serious load on your server. You could instead set up auto-archiving to occur somewhat more frequently (hourly, for example) which is explained here: piwik.org/docs/setup-auto-archiving/