Tracking API take long waiting time in Waterfall test


Waterfall test showed piwik take very longer waiting request for smaller size data compared from other request in the page.

When i open the URL it only the smaller Image…
transfer, about 300ms-600ms

Here the test repot from GTMetrix for my site
I get the same error for newer version of PIWIK…
I don’t know how to fix this, search on the web still not get solution…
Can you give me the solution?



In theory even though your tracking requests are quite slow (they should be <200ms) that shouldn’t be that much of a problem. They are loaded async and deferred, so only after the visitor is able to interact with the complete website.

But I totally get that you might want to get this down.

You could try to speed up your Matomo instance a bit:

Especially a fast database on an SSD which has enough RAM can help.

But if you are really annoyed by this and want to get the requests down to ~50ms you can look into queued tracking:

Then Matomo will only put the data as is into a query (either in the MySQL/MariaDB database or in Redis) and e.g. if the query is at a specific length (e.g. 10 entries) all of them will be handled by Matomo at once.

1 Like

@sokhanh21xn hín Did you find a solution to speed up Matomo’s waiting time?

I have disabled half of Matomo’s unused plugins. 18 active plugins are left. I also installed Queued Tracking. Requests are between excellent ~50ms, but also ~180ms. What is your average loading time with Matomo? I know it also related to CPU power, RAM, SSD, WebServer… just curious :nerd_face:


Disabling plugins won’t do much as the ones that don’t affect tracking are not loaded at all during tracking requests.

If you use Queued Tracking with Redis things like disk speed should not matter at all as the whole request shouldn’t cause a single disk read or write.
Have you by chance enabled OPcache in PHP?

@Lukas Indeed, OPcache is enabled. I though it would dramatically improve speed. For quick testing I am using Queued Tracking with MySQL.


Just a random thought:

Have you tried creating a simple PHP script like


echo "test";

and put it in the same directory as Matomo and checked how long requests to it take. This way you can easily separate the overhead of Matomo from the overhead of your webserver and PHP setup.

@Lukas Thanks, It takes around ~14-20ms