Why is it bad to run the archive-cronjob more often?


we have a medium to (sometimes) high traffic website, and we setup a cronjob for archiving. I’m not sure I understand correctly why a high traffic website should limit the archiving to once per hour: Wouldn’t it be better to run the archiving more often to avoid a performance peak every hour?

My problem is, too, that we got users who want to do some evaluations in “real time” telling me that they need the data every 5 minutes and not after 1 hour.

So why is it bad to run the archive-cronjob more often/every 5 minutes?

Archiving will compile all data for:

  • The whole day
  • The whole week
  • The whole month
  • The whole year
    Since some KPIs need to be calculated each time from scratch (eg. returning users, bounce rate, etc.), then calculate more often won’t allow you to save time… Instead it will consume more CPU ,memory, etc.

Try to get the time the archiving takes (during peak hours). This is the minimal delay for archive cron job (and don’t forget to take also some additional security margins in case of huge peak)

1 Like

I see, thanks for the clarification!