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

Check that Tracker performance did not regress #7718

Closed
tsteur opened this issue Apr 20, 2015 · 12 comments
Closed

Check that Tracker performance did not regress #7718

tsteur opened this issue Apr 20, 2015 · 12 comments
Assignees
Labels
c: Performance For when we could improve the performance / speed of Matomo. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Apr 20, 2015

This was especially noticed in combination with QueuedTracking where the response time of one tracker request used to be about 4ms. It is now about 20-40ms depending on the server etc. Most of the time is spent in reading the ini config and static container / dependency injection.

I reckon the normal tracker mode got a bit slower as well but as a normal request takes maybe 50-200ms anyway the regression is probably not that much of a problem.

I uploaded a profile here: https://blackfire.io/profiles/983424c0-aa7e-446c-823b-59955f48212f/graph

In this case a client decided to use the QueuedTracking as it was very important to have a very fast tracker response time but the performance regressed.

@diosmosis
Copy link
Member

Is this related: #7711 ?

@tsteur
Copy link
Member Author

tsteur commented Apr 20, 2015

Maybe, we'd need to profile again after #7711 is merged to see how it performs and whether still something makes it "slower".

@mnapoli
Copy link
Contributor

mnapoli commented Apr 20, 2015

In the profiling you linked to 63% of the time is spent in Profiler::setProfilingRunIds(), it would be great to profile without any different code being executed in Piwik.

@diosmosis
Copy link
Member

FYI I made some changes in profiler setup in #7711 so that wouldn't happen, you can look through the branch to apply the changes locally for profiling.

EDITED

@mnapoli
Copy link
Contributor

mnapoli commented Apr 20, 2015

By the way did you profile with composer dump-autoload -o? It seems Composer is doing some file_exists where it shouldn't when using the classmap (though I'm not 100% certain)

@tsteur
Copy link
Member Author

tsteur commented Apr 20, 2015

The profile is not really relevant in this case. The profile shows it took 50ms or more but the 20-40ms I mentioned is with no profiling enabled etc. This used to be 4ms.

@diosmosis
Copy link
Member

Right, but w/o an accurate profile, how will we diagnose + test the issue? Can you tell us what Piwik version was used when the tracker was fast?

@tsteur
Copy link
Member Author

tsteur commented Apr 20, 2015

I'm just saying there seems to be a regression that's all. One can at least see where some time is spent and everything else has to be looked into when actually working on this issue anyway.

I reckon this was around December 2014 when the QueuedTracking plugin was built so probably 2.9.0 or 2.10.0.

@mattab
Copy link
Member

mattab commented Jul 14, 2015

Let's take a look at Tracker API performance and profile it for 2.15.0. it shouldn't take long (ie. couple hours?) to figure out if something is slow or not, and if we really regressed performance, it would be high value to make tracker faster again.

@mattab mattab added this to the 2.15.0 milestone Jul 14, 2015
@mattab mattab added the c: Performance For when we could improve the performance / speed of Matomo. label Jul 14, 2015
@tsteur
Copy link
Member Author

tsteur commented Aug 6, 2015

I uploaded an xhprof profile for a single pageview here: https://blackfire.io/profiles/4396e3dd-d9cf-4c48-a337-b5e4737057af/graph It looks good and seems like nothing regressed extremely.

Here is a profile taken with xhprof of a bulk request (with 133 requests): https://blackfire.io/profiles/1849a1c0-6483-4b4c-84eb-9f2d3896951c/graph. I can't tell if anything regressed but didn't find anything that worried me. A lot of time was spend in $visit->isExcluded() (27.5%) but we can probably not do much here

@tsteur tsteur closed this as completed Aug 6, 2015
@tsteur tsteur self-assigned this Aug 6, 2015
@mnapoli
Copy link
Contributor

mnapoli commented Aug 6, 2015

Time spent in Composer and loading files seems very high in your first profile, I already asked this but did you optimize the autoloader? And did you remove dev dependencies (as they can overload the classmap and make a difference in short lived processes)? Also I don't know if you still use PHP 5.4 but did you use an opcache (and warm it up)? (especially since Vagrant's vboxfs, or even nfs, are much slower than native FS)

Anyway good to know there is no regression.

@tsteur
Copy link
Member Author

tsteur commented Aug 6, 2015

yes autoloader optimized, I didn't remove dev dependencies but that's not really important in this case. It's PHP 5.5 with opcache and warmed up of course

@mattab mattab changed the title Tracker performance regressed Check that Tracker performance did not regress Aug 9, 2015
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

4 participants