Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow report website and dashboard in Piwik 2.10.0 #7031

Closed
noogen opened this issue Jan 15, 2015 · 3 comments
Closed

Slow report website and dashboard in Piwik 2.10.0 #7031

noogen opened this issue Jan 15, 2015 · 3 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@noogen
Copy link

noogen commented Jan 15, 2015

Hi,

I'm using Piwik 2.10.0 and experiencing slow website response of about 1+ minute for 6+ million records in monthly archive table. I trace it down to the daily archive blob being update/invalidate every time the UI try to read from archive.

Background

  • My Piwik instance track 8 Sites with about ~100K visits per day across all sites.
  • My original setup was 2ecu + 2gb VPS, but it was unbearably slow. I have since throw a ton of hardware at it and done a lot of optimization. The current setup is:
  • pi.mysite.com: 8cpu + 8gb of ram to handle tracking from client
  • report.mysite.com: 10cpu + 10gb of ram + 100GB RAID10 for MySQL and cron archiving

Most of the time, CPU on report.mysite.com is only at 10% and memory at 60%. High memory usage is the result of TokuDB engine my MySQL setup.

With such beefy setup, I still get timeouts with cron archive and website even though my CPU and Memory usage stay the same. I'm almost at the point of giving up, but then I notice a pattern. It usually happen toward the end of the month and at the end of the day.

Debug

As it is reproducible, I did some SQL troubleshooting and identify that the issue has to do with the SQL executed from this module:
https://github.com/noogen/piwik/blob/master/core/DataAccess/Model.php - line 75: updateArchiveAsInvalidated

Issue was identified that the website always call the "get" method of report archiving causing slow UI response. Somehow, this SQL cause a full table read resulting in 1 second for every 1 million record in the monthly archive table. I move this invalidation in "Archive.php" from "get" method to "prepareArchive" method. This allow the cron job to continue to work while reducing the issue in the UI.

I have also prepared a pull request. The change is simple but please review because I do not know the inner working of Piwik as I am not a regular Piwik Developer.

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Jan 16, 2015
@mattab mattab added this to the Piwik 2.11.0 milestone Jan 16, 2015
@mattab
Copy link
Member

mattab commented Jan 16, 2015

Hi @noogen thanks for the report!

tsteur added a commit that referenced this issue Jan 22, 2015
…ive, should make some reports faster especially when browser archiving is disabled
@tsteur
Copy link
Member

tsteur commented Jan 22, 2015

@noogen do you mind having a look whether this patch makes the report faster 4df10df ? Can you apply this change to your code?

@tsteur tsteur self-assigned this Jan 22, 2015
@tsteur
Copy link
Member

tsteur commented Jan 26, 2015

Please reopen in case it does not make it faster. Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants