Closed anonymous-matomo-user closed 11 years ago
Piwik does not lock the log_link_visit_action table.
Since you're using cron for archiving, you should disable browser-triggered archiving. It sounds like browser-triggered archiving is still enabled causing the lag on your dashboard.
Browser-triggered archiving is not enabled.
The cronjob runs at 5 past every hour and from 5 past until 8 to 10 past Piwik does not answer any tracking queries.
I'd like to request a feature which would temporarily disable tracking during the archiving process (so when table locks on the tracking tables are attained the tracking should be disabled).
Why?
Archiving (when we run the task every hour) takes about 3-5 minutes during which our webpages will seem to never finish loading (everything is there though, the browser is simply waiting for a reply from Piwik). For us this is not acceptable and as such we would prefer Piwik to temporarily disable tracking.
An additional note is that even if tracking is not disabled during the archiving most actions during that period will be lost anyway, because the user will already be on another page. (Or does the script not exit on user abort?)
In my opinion adding this as a setting would increase the usability of Piwik on medium sized websites.
First of all: does Piwik acquire table locks on the following tables during archiving: piwik_log_link_visit_action, piwik_log_visit and/or piwik_log_action? If not you can ignore the following.
Another option might be the following:
It appears the 'piwik_log_link_visit_action' table is the largest and as far as I can tell a (visitor initiated) query will never have to read from this table (because it simply records each time a page is viewed).
So if you were to use two tables: 'piwik_log_link_visit_action_A' and 'piwik_log_link_visit_action_B' you could achieve a table lock on A and write all new actions to B, after which you would acquire a table lock on B and write all new actions to A.
I include this as a second suggestion because this will probably require some major rewrites in the code, but I do think it will allow Piwik to track much larger websites efficiently.
You could of course even expand this concept into having the 'piwik_log_link_visit_action' table spread over different servers.