I have a website with about 300 000 page views per day. I have a requirement to show total views count on most of pages. Of course, I can’t get data from piwik on each page view, so I have an intermediate data store, like a cache, storing url-count values. But I still need to keep it rather actual (1 hour delay, for example).
My solution was rather simple: every 5 minutes cron runs a script, which gathers data about page visited during that interval using Live.getLastVisitsDetails method. It adds urls to queue. Queue handler calls VisitsSummary.getVisits to get total count and writes it to intermediate data store.
Now, the problem - VisitsSummary.getVisits works really slow. Queue grows extremely fast and counters on the site are out of date.
Is it real to get it working using piwik? How can I optimise this process? I mean, maybe its possible to get multiple counters in one query? I know its possible to make multiple API requests using one HTTP request, but logically it won’t help.