Matomo Performance (Page Speed)

(Serdar) #1


My website is extremely fast. It takes between 300-500 ms to fully load. Anyway, I have installed Matomo on my blog today.

The piwik.js is loading fast but the piwik.php always takes 360 ms to load (see below). Is it usual?
I’m using Cloudflare CDN.

Thank you,
Best regards.

(Lukas Winkler) #2


It depends on how fast your Matomo server is. Keep in mind that this shouldn’t slow down your website as it is loaded asynchronously and deferred, so only after the user can interact with the website.

If this is still bugging you and you want to get it down to <30ms you can take a look at the Queued Tracking - Matomo Plugins Marketplace plugin. It makes the piwik.php only store the raw request in MySQL or Redis (which is faster) and then asynchronously handles the requests once the query is longer than x.

(Fabian Dellwing) #3

360ms is definitely to long, a normal pageview should maybe take 20-60ms depending on your server. Are you sending more than the default parameters with your tracking script?

(Serdar) #4

I give Matomo second chance today. Response of piwik.php is still 300ms. I don’t have redis in the server. But I have memcached PECL module. Everything in my server is working blazing fast except piwik.php file.

Features of my server;

  • Nginx
  • PHP7.2-FPM
  • MariaDB
  • Memcached

My question is that, If I set a special cache rule for the piwik.php on Cloudflare, it helps me to reduce response time?

The special cache rule will be:* —> Cache Everything

Sorry, I’m noob about php.

(Lukas Winkler) #5

You don’t need redis, you can also use the MySQL database for queued tracking.

Yes, it will strongly reduce the response time as the data will stop ending up in Matomo, but just be sent to cloudflare. So you would stop recording the user page views as they never reach Matomo.